summaryrefslogtreecommitdiff
path: root/src/or/connection.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/connection.c')
-rw-r--r--src/or/connection.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index 93df99f7ef..e781ff24c1 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -564,6 +564,7 @@ int connection_package_raw_inbuf(connection_t *conn) {
assert(!connection_speaks_cells(conn));
repeat_connection_package_raw_inbuf:
+ assert(conn->package_window > 0);
circ = circuit_get_by_conn(conn);
if(!circ) {
@@ -620,13 +621,12 @@ repeat_connection_package_raw_inbuf:
}
assert(conn->package_window > 0);
- conn->package_window--;
-// if(--conn->package_window <= 0) { /* is it 0 after decrement? */
-// connection_stop_reading(conn);
-// log_fn(LOG_DEBUG,"conn->package_window reached 0.");
-// circuit_consider_stop_edge_reading(circ, conn->type, conn->cpath_layer);
-// return 0; /* don't process the inbuf any more */
-// }
+ if(--conn->package_window <= 0) { /* is it 0 after decrement? */
+ connection_stop_reading(conn);
+ log_fn(LOG_DEBUG,"conn->package_window reached 0.");
+ circuit_consider_stop_edge_reading(circ, conn->type, conn->cpath_layer);
+ return 0; /* don't process the inbuf any more */
+ }
log_fn(LOG_DEBUG,"conn->package_window is now %d",conn->package_window);
/* handle more if there's more, or return 0 if there isn't */