]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
make the conn->package_window bug go away.
authorRoger Dingledine <arma@torproject.org>
Mon, 25 Aug 2003 21:43:51 +0000 (21:43 +0000)
committerRoger Dingledine <arma@torproject.org>
Mon, 25 Aug 2003 21:43:51 +0000 (21:43 +0000)
not resolved, but at least the servers will stop crashing.

svn:r416

src/or/connection.c

index e781ff24c1af3bce3ae9f2067a29ece595ed2bc3..cc39119a8b6b51cc8d96504b30ac8e01ea26f654 100644 (file)
@@ -564,7 +564,6 @@ 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) {
@@ -575,6 +574,12 @@ repeat_connection_package_raw_inbuf:
   if(circuit_consider_stop_edge_reading(circ, conn->type, conn->cpath_layer))
     return 0;
 
+  if(conn->package_window <= 0) {
+    log_fn(LOG_ERR,"called with package_window 0. Tell Roger.");
+    connection_stop_reading(conn);
+    return 0;
+  }
+
   amount_to_process = conn->inbuf_datalen;
 
   if(!amount_to_process)