Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#4108 closed defect (fixed)

Silence warning "Bug: stream (marked at connection_edge.c:2224) sending two socks replies?"

Reported by: fk Owned by:
Priority: Low Milestone: Tor: 0.2.3.x-final
Component: Core Tor/Tor Version: Tor: 0.2.3.4-alpha
Severity: Keywords: regression tor-client
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

When a client sends an HTTP request to Tor's SocksPort, it results in Tor logging:

Sep 25 16:38:42.830 [warn] {APP} Socks version 72 not recognized. (Tor is not an http proxy.)
Sep 25 16:38:42.830 [warn] {BUG} _connection_mark_unattached_ap(): Bug: stream (marked at connection_edge.c:2224) sending two socks replies?

The client only gets a single reply (the Tor is not a HTTP proxy message), so the bug here seems to be that the warning is shown.

I'll attach a patch that silences the warning for me.

Setting socks->has_finished anywhere before calling _connection_mark_unattached_ap() should do, so maybe it should be set earlier.

I'm not entirely sure if the (sockshere == -1) check is necessary.

Child Tickets

Attachments (1)

tor-0.2.3.4-alpha-silence-two-socks-reply-warning.patch (1.2 KB) - added by fk 8 years ago.
In connection_ap_handshake_process_socks(), mark the socks request as finished if a reply is send after a parse error

Download all attachments as: .zip

Change History (8)

Changed 8 years ago by fk

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

comment:1 Changed 8 years ago by nickm

Status: newneeds_review

Looks good, and looks like a potential candidate for 0.2.2 (unless this bug is new in 0.2.3).

Before I merge, I also want to investigate and look for other cases like this, and also make sure that has_finished is actually code for sent_socks_reply; the documentation should be more explicit there if so.

comment:2 in reply to:  1 Changed 8 years ago by arma

Replying to nickm:

looks like a potential candidate for 0.2.2 (unless this bug is new in 0.2.3).

I can reproduce on git master (just telnet to your socksport and type G), but no such warning shows up for maint-0.2.2.

comment:3 Changed 8 years ago by rransom

Milestone: Tor: 0.2.3.x-final

comment:4 Changed 8 years ago by nickm

Keywords: regression added

comment:5 Changed 7 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

Merged at last

comment:6 Changed 7 years ago by nickm

Keywords: tor-client added

comment:7 Changed 7 years ago by nickm

Component: Tor ClientTor
Note: See TracTickets for help on using tickets.