]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
fix the other half of the pipe race
authorRoger Dingledine <arma@torproject.org>
Tue, 7 Dec 2004 16:37:32 +0000 (16:37 +0000)
committerRoger Dingledine <arma@torproject.org>
Tue, 7 Dec 2004 16:37:32 +0000 (16:37 +0000)
svn:r3111

src/or/connection.c
src/or/connection_edge.c

index 4f076c3d64e0c5dc5b929745f1abd584a4ec7bca..2669f074d25c82ca3c962b474bbb057100890055 100644 (file)
@@ -236,6 +236,8 @@ void connection_about_to_close_connection(connection_t *conn)
       if (conn->socks_request->has_finished == 0) {
         log_fn(LOG_INFO,"Cleaning up AP -- sending socks reject.");
         conn->hold_open_until_flushed = 1;
+        /* XXX this socks_reply never gets sent, since conn
+         * gets removed right after this function finishes. */
         connection_ap_handshake_socks_reply(conn, NULL, 0, -1);
         conn->socks_request->has_finished = 1;
       } else {
index 49d91f855acb763c133b98166285e8970465ece8..53e7b68c81c537847f149f8c5fc95002389514eb 100644 (file)
@@ -45,9 +45,9 @@ int connection_edge_reached_eof(connection_t *conn) {
     /* only mark it if not already marked. it's possible to
      * get the 'end' right around when the client hangs up on us. */
     connection_mark_for_close(conn);
+    conn->hold_open_until_flushed = 1; /* just because we shouldn't read
+                                          doesn't mean we shouldn't write */
   }
-  conn->hold_open_until_flushed = 1; /* just because we shouldn't read
-                                        doesn't mean we shouldn't write */
   return 0;
 #endif
 }