summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--papyon/gnet/io/sock.py4
-rw-r--r--papyon/gnet/io/ssl_socket.py4
-rw-r--r--papyon/msnp/switchboard.py1
3 files changed, 9 insertions, 0 deletions
diff --git a/papyon/gnet/io/sock.py b/papyon/gnet/io/sock.py
index 15825ba..7130588 100644
--- a/papyon/gnet/io/sock.py
+++ b/papyon/gnet/io/sock.py
@@ -24,6 +24,7 @@ from iochannel import GIOChannelClient
import gobject
import socket
+import sys
__all__ = ['SocketClient']
@@ -74,6 +75,9 @@ class SocketClient(GIOChannelClient):
return False
if buf != "":
self.emit("received", buf, len(buf))
+ elif sys.platform != "win32":
+ self.close()
+ return False
# Check for error/EOF
if cond & (gobject.IO_ERR | gobject.IO_HUP):
diff --git a/papyon/gnet/io/ssl_socket.py b/papyon/gnet/io/ssl_socket.py
index cb7f25e..0d49c99 100644
--- a/papyon/gnet/io/ssl_socket.py
+++ b/papyon/gnet/io/ssl_socket.py
@@ -24,6 +24,7 @@ from iochannel import GIOChannelClient
import gobject
import socket
+import sys
import OpenSSL.SSL as OpenSSL
__all__ = ['SSLSocketClient']
@@ -83,6 +84,9 @@ class SSLSocketClient(GIOChannelClient):
buf = self._transport.recv(2048)
if buf != "":
self.emit("received", buf, len(buf))
+ elif sys.platform != "win32":
+ self.close()
+ return False
except (OpenSSL.WantX509LookupError,
OpenSSL.WantReadError, OpenSSL.WantWriteError):
pass
diff --git a/papyon/msnp/switchboard.py b/papyon/msnp/switchboard.py
index 7bb3d83..14c6eff 100644
--- a/papyon/msnp/switchboard.py
+++ b/papyon/msnp/switchboard.py
@@ -179,6 +179,7 @@ class SwitchboardProtocol(BaseProtocol):
return
if self.inactivity_timer_id:
gobject.source_remove(self.inactivity_timer_id)
+ self.inactivity_timer_id = 0
if inactivity:
logger.info("Switchboard timed out. Going to leave it.")
logger.info("Leaving switchboard %s" % self.__session_id)