Ticket #4108: tor-0.2.3.4-alpha-silence-two-socks-reply-warning.patch

File tor-0.2.3.4-alpha-silence-two-socks-reply-warning.patch, 1.2 KB (added by fk, 9 years ago)

In connection_ap_handshake_process_socks(), mark the socks request as finished if a reply is send after a parse error

  • src/or/connection_edge.c

    From e16373a732d507dc8065352d397f74d522f210b5 Mon Sep 17 00:00:00 2001
    From: Fabian Keil <fk@fabiankeil.de>
    Date: Sun, 25 Sep 2011 16:32:43 +0200
    Subject: [PATCH] In connection_ap_handshake_process_socks(), mark the socks
     request as finished if a reply is send after a parse error
    
    Silences the log message:
    [warn] {BUG} _connection_mark_unattached_ap(): Bug: stream (marked at connection_edge.c:2224) sending two socks replies?
    after the client triggered the "Tor is not an HTTP Proxy" response.
    
    No additional socks reply was sent, though.
    ---
     src/or/connection_edge.c |    5 +++++
     1 files changed, 5 insertions(+), 0 deletions(-)
    
    diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
    index f59f44c..6ebedbb 100644
    a b connection_ap_handshake_process_socks(entry_connection_t *conn) 
    22082208    connection_write_to_buf((const char*)socks->reply, socks->replylen,
    22092209                            base_conn);
    22102210    socks->replylen = 0;
     2211    if (sockshere == -1) {
     2212      /* An invalid request just got a reply, no additional
     2213       * one is necessary. */
     2214      socks->has_finished = 1;
     2215    }
    22112216  }
    22122217
    22132218  if (sockshere == 0) {