move plug_idle into socks5queue

This commit is contained in:
Jefry Lagrange 2011-08-01 23:12:30 -04:00
parent af9d304c52
commit af2e7c89af
1 changed files with 3 additions and 2 deletions

View File

@ -328,6 +328,8 @@ class SocksQueue:
if sock_hash not in self.senders:
self.senders[sock_hash] = Socks5Sender(self.idlequeue, sock_hash, self,
sock[0], sock[1][0], sock[1][1], fingerprint='server')
# Start waiting for data
self.idlequeue.plug_idle(self.senders[sock_hash], False, True)
self.connected += 1
def process_result(self, result, actor):
@ -764,8 +766,7 @@ class Socks5Sender(Socks5, IdleObject):
self.connected = True
self.state = 1 # waiting for first bytes
self.file_props = None
# start waiting for data
self.idlequeue.plug_idle(self, False, True)
def read_timeout(self):
self.idlequeue.remove_timeout(self.fd)