]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Don't warn about not sending a socks reply if we get a write error
authorNick Mathewson <nickm@torproject.org>
Tue, 12 Mar 2013 21:36:09 +0000 (17:36 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 12 Mar 2013 21:36:09 +0000 (17:36 -0400)
If we get a write error on a SOCKS connection, we can't send a
SOCKS reply, now can we?

This bug has been here since 36baf7219, where we added the "hey, I'm
closing an AP connection but I haven't finished the socks
handshake!" message.  It's bug 8427.

changes/bug8427 [new file with mode: 0644]
src/or/connection.c

diff --git a/changes/bug8427 b/changes/bug8427
new file mode 100644 (file)
index 0000000..22b003f
--- /dev/null
@@ -0,0 +1,5 @@
+  o Minor bugfixes:
+    - If we encounter a write failure on a SOCKS connection before we
+      finish our SOCKS handshake, don't warn that we closed the
+      connection before we could send a SOCKS reply. Fixes bug 8427;
+      bugfix on 0.1.0.1-rc.
index eac9c4f32bb982ea876dbce73ae98c50107362ba..75c165620628451aab121ef3c7953a036eb992bf 100644 (file)
@@ -3286,6 +3286,10 @@ connection_handle_write_impl(connection_t *conn, int force)
     if (result < 0) {
       if (CONN_IS_EDGE(conn))
         connection_edge_end_errno(TO_EDGE_CONN(conn));
+      if (conn->type == CONN_TYPE_AP) {
+        /* writing failed; we couldn't send a SOCKS reply if we wanted to */
+        TO_ENTRY_CONN(conn)->socks_request->has_finished = 1;
+      }
 
       connection_close_immediate(conn); /* Don't flush; connection is dead. */
       connection_mark_for_close(conn);