Skip to content

Commit

Permalink
cosmetical changes
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbers committed Aug 10, 2012
1 parent 04390e9 commit 7f85be8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions quick_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import socket
import errno
import time
from time import sleep
from threading import Thread
from glob import glob
from select import select
Expand Down Expand Up @@ -130,8 +130,8 @@ def run(self):
want_write.remove(s)
continue

# handling a new connect to the proxy
if proxy in ready_read:
# there was a new connect to proxy
client, address = proxy.accept()
client.setblocking(0)

Expand Down Expand Up @@ -191,17 +191,17 @@ def run(self):
s_pair.shutdown(socket.SHUT_RD)
else:
s_pair.close()

s.close()
break

for s in ready_write:
if not data_to_send[s]:
want_write.remove(s)
if s in closed_but_data_left_sockets:
closed_but_data_left_sockets.remove(s)
del data_to_send[s]
s.close()
closed_but_data_left_sockets.remove(s)

want_write.remove(s)
break

try:
Expand All @@ -222,4 +222,4 @@ def run(self):
p.start()

while True:
time.sleep(1337)
sleep(1337)

0 comments on commit 7f85be8

Please sign in to comment.