summaryrefslogtreecommitdiff
path: root/sleekxmpp/xmlstream/filesocket.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2013-06-22 14:35:20 -0700
committerLance Stout <lancestout@gmail.com>2013-06-22 14:35:20 -0700
commite76a48393159592e73421541ed05e78c287faf00 (patch)
tree4875c5a9d3e2df57f79b8e3800470ce315a8c1e7 /sleekxmpp/xmlstream/filesocket.py
parentc0437d2de86f5b6ffce17061fc3aed0e35441fd3 (diff)
parent37a804320204726480732704036fad9c7f6fff78 (diff)
downloadslixmpp-e76a48393159592e73421541ed05e78c287faf00.tar.gz
slixmpp-e76a48393159592e73421541ed05e78c287faf00.tar.bz2
slixmpp-e76a48393159592e73421541ed05e78c287faf00.tar.xz
slixmpp-e76a48393159592e73421541ed05e78c287faf00.zip
Merge branch 'develop' of github.com:fritzy/SleekXMPP into develop
Diffstat (limited to 'sleekxmpp/xmlstream/filesocket.py')
-rw-r--r--sleekxmpp/xmlstream/filesocket.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/sleekxmpp/xmlstream/filesocket.py b/sleekxmpp/xmlstream/filesocket.py
index d4537998..53b83bc7 100644
--- a/sleekxmpp/xmlstream/filesocket.py
+++ b/sleekxmpp/xmlstream/filesocket.py
@@ -13,6 +13,7 @@
"""
from socket import _fileobject
+import errno
import socket
@@ -29,7 +30,13 @@ class FileSocket(_fileobject):
"""Read data from the socket as if it were a file."""
if self._sock is None:
return None
- data = self._sock.recv(size)
+ while True:
+ try:
+ data = self._sock.recv(size)
+ break
+ except socket.error as serr:
+ if serr.errno != errno.EINTR:
+ raise
if data is not None:
return data