Permalink
Browse files

make sure wait_read is only used in sync mode

  • Loading branch information...
1 parent e506971 commit 99580ce24d8f10f5279588808f0967c8a389dddc @tarekziade tarekziade committed Mar 7, 2013
Showing with 6 additions and 1 deletion.
  1. +6 −1 vaurien/util.py
View
@@ -190,7 +190,12 @@ def get_data(sock, buffer=1024):
except error, e:
if e.args[0] not in (EWOULDBLOCK, EAGAIN):
raise
- wait_read(sock.fileno(), timeout=sock.gettimeout())
+ timeout = sock.gettimeout()
+ if timeout == 0:
+ # we are in async mode here so we just need to switch
+ sleep(0)
+ else:
+ wait_read(sock.fileno(), timeout=timeout)
def extract_settings(args, prefix, name):

0 comments on commit 99580ce

Please sign in to comment.