[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[or-cvs] OP was hanging on first try if connect finishes too quickly



Update of /home/or/cvsroot/src/or
In directory moria.seul.org:/home/arma/work/onion/cvs/src/or

Modified Files:
	connection_op.c connection_or.c 
Log Message:
OP was hanging on first try if connect finishes too quickly



Index: connection_op.c
===================================================================
RCS file: /home/or/cvsroot/src/or/connection_op.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- connection_op.c	4 Sep 2002 06:24:54 -0000	1.9
+++ connection_op.c	20 Sep 2002 19:33:13 -0000	1.10
@@ -27,7 +27,6 @@
   }
 
   return 0;
-
 }
 
 int op_handshake_process_keys(connection_t *conn) {
@@ -90,7 +89,7 @@
   connection_init_timeval(conn);
   connection_watch_events(conn, POLLIN);
 
-  return 0;
+  return connection_process_inbuf(conn); /* in case they sent some cells along with the keys */
 }
 
 int connection_op_finished_flushing(connection_t *conn) {

Index: connection_or.c
===================================================================
RCS file: /home/or/cvsroot/src/or/connection_or.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- connection_or.c	4 Sep 2002 06:29:28 -0000	1.12
+++ connection_or.c	20 Sep 2002 19:33:13 -0000	1.13
@@ -89,7 +89,7 @@
       conn->state = OR_CONN_STATE_OPEN;
       connection_init_timeval(conn);
       connection_watch_events(conn, POLLIN);
-      return 0;
+      return connection_process_inbuf(conn); /* in case there's anything waiting on it */
     case OR_CONN_STATE_SERVER_SENDING_AUTH:
       log(LOG_DEBUG,"connection_or_finished_flushing(): server finished sending auth.");
       conn->state = OR_CONN_STATE_SERVER_NONCE_WAIT;
@@ -331,8 +331,7 @@
   conn->state = OR_CONN_STATE_OPEN;
   connection_init_timeval(conn);
   connection_watch_events(conn, POLLIN); /* give it a default, tho the ap_handshake call may change it */
-  ap_handshake_n_conn_open(conn); /* send the pending onion */
-  return 0;
+  return ap_handshake_n_conn_open(conn); /* send the pending onion */
 
 }