[tor-bugs] #1667 [Tor Client]: Give a more appropriate "I'm not an HTTP proxy" message when we get an HTTP request on the control port
Tor Bug Tracker & Wiki
torproject-admin at torproject.org
Fri Feb 24 19:00:36 UTC 2012
#1667: Give a more appropriate "I'm not an HTTP proxy" message when we get an HTTP
request on the control port
----------------------------+-----------------------------------------------
Reporter: nickm | Owner:
Type: enhancement | Status: needs_review
Priority: trivial | Milestone: Tor: unspecified
Component: Tor Client | Version:
Resolution: | Keywords: easy
Parent: | Points:
Actualpoints: |
----------------------------+-----------------------------------------------
Comment(by rransom):
Replying to [comment:11 neena]:
> Replying to [comment:10 rransom]:
> > `strcasecmp` should be the wrong function. Perhaps you want
`strcasecmpstart`?
>
> Used a switch-case, like the "Tor is not an HTTP Proxy" code instead.
This would be fine except that almost every controller we care about
starts its control connections by sending “`PROTOCOLINFO\r\n`”. You
really do need to use something like `strcasecmpstart` (defined in
src/common/util.h and .c; hopefully I'm spelling its name correctly) to
compare the first chunk of data with “`GET `”, “`POST `”, etc.. (The
SOCKSPort code only looks at the first byte because the first byte sent on
a SOCKS connection must be the SOCKS version number.)
Other than that, looks good!
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/1667#comment:12>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list