[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [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



#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
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs