]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix a bug warning when sending an error on an HTTPTunnelPort conn
authorNick Mathewson <nickm@torproject.org>
Tue, 21 Aug 2018 14:12:04 +0000 (10:12 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 21 Aug 2018 14:12:04 +0000 (10:12 -0400)
Fixes bug 26470; bugfix on 0.3.2.1-alpha.

changes/bug26470 [new file with mode: 0644]
src/or/connection_edge.c

diff --git a/changes/bug26470 b/changes/bug26470
new file mode 100644 (file)
index 0000000..854ec7e
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor bugfixes (HTTP tunnel):
+    - Fix a bug warning when closing an HTTP tunnel connection due to
+      an HTTP request we couldn't handle. Fixes bug 26470; bugfix on
+      0.3.2.1-alpha.
index f178917f0bfe21725100b8f4eb6d6b934cd4d3d4..b4e544c8f6f2e7be29f884b3c97c83c6b6589fac 100644 (file)
@@ -2537,8 +2537,11 @@ connection_ap_process_http_connect(entry_connection_t *conn)
  err:
   if (BUG(errmsg == NULL))
     errmsg = "HTTP/1.0 400 Bad Request\r\n\r\n";
-  log_warn(LD_EDGE, "Saying %s", escaped(errmsg));
+  log_info(LD_EDGE, "HTTP tunnel error: saying %s", escaped(errmsg));
   connection_buf_add(errmsg, strlen(errmsg), ENTRY_TO_CONN(conn));
+  /* Mark it as "has_finished" so that we don't try to send an extra socks
+   * reply. */
+  conn->socks_request->has_finished = 1;
   connection_mark_unattached_ap(conn,
                                 END_STREAM_REASON_HTTPPROTOCOL|
                                 END_STREAM_REASON_FLAG_ALREADY_SOCKS_REPLIED);
@@ -4162,4 +4165,3 @@ connection_edge_free_all(void)
   smartlist_free(pending_entry_connections);
   pending_entry_connections = NULL;
 }
-