if(result > 0 && !is_local_IP(conn->addr)) { /* remember it */
rep_hist_note_bytes_read(result, time(NULL));
- connection_read_bucket_decrement(conn, result);
}
+ /* Call even if result is 0, since the global read bucket may
+ * have reached 0 on a different conn, and this guy needs to
+ * know to stop reading. */
+ /* Longer-term, we should separate this out to read_bucket_decrement
+ * and consider_empty_buckets, and just call the second one always. */
+ connection_read_bucket_decrement(conn, result);
+
return 0;
}