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

Re: [tor-bugs] #5519 [Vidalia]: Some improvements for torcontrol code (ControlConnection, ControlSocket classes) (was: Some improvements for torcontrol code (ControlSocket class))



#5519: Some improvements for torcontrol code (ControlConnection, ControlSocket
classes)
---------------------+------------------------------------------------------
 Reporter:  sebb     |          Owner:  sebb                
     Type:  task     |         Status:  assigned            
 Priority:  minor    |      Milestone:                      
Component:  Vidalia  |        Version:  Vidalia: 0.3.1-alpha
 Keywords:           |         Parent:                      
   Points:           |   Actualpoints:                      
---------------------+------------------------------------------------------
Changes (by sebb):

  * status:  new => assigned
  * priority:  trivial => minor


Comment:

 After analyzing the connections between torControl, control socket and
 control connection objects, I think I've found a case when Control
 Connection can loop forever, here is possible fail scenario:

 1) command is added to _recvQueue: for example GETINFO command waiting
 2) tor crashes
 3) control socket disconnects -> "disconnected" signal is fired
 4) control connection calls onDisconnected() -> status change to
 "disconnected", isConnected will return "false" from now on
 5) torcontrol wants to call "disconnect" manually (in "onStopped" slot),
 but isConnected() returns false
 6) disconnect is neved called, so all recvwaiter objects will wait forever

 problem is that "recvQueue" is cleared only in "disconnect" slot of
 ControlConnection class, so its possible to "turn off" the
 ControlConnection without clearing it
 I think its enough to always clear recvQueue in control connection before
 attempt to change status to "disconnected" - we can just reuse the code
 from "disconnect"

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/5519#comment:2>
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