summaryrefslogtreecommitdiff
blob: 77a4b2993c0c822aa858a47de88b925749d187bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--- M2Crypto/SSL/Connection.py.orig	2008-02-24 12:27:31.000000000 +0100
+++ M2Crypto/SSL/Connection.py	2008-02-24 12:28:26.000000000 +0100
@@ -4,6 +4,8 @@
 
 # Python
 import socket
+import struct
+sizeof_timeval = struct.calcsize('ll')
 
 # M2Crypto
 from Cipher import Cipher, Cipher_Stack
@@ -325,10 +327,10 @@
         return m2.ssl_get_default_session_timeout(self.ssl)
 
     def get_socket_read_timeout(self):
-        return timeout.struct_to_timeout(self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_RCVTIMEO, 8))
+        return timeout.struct_to_timeout(self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_RCVTIMEO, sizeof_timeval))
 
     def get_socket_write_timeout(self):
-        return timeout.struct_to_timeout(self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_SNDTIMEO, 8))
+        return timeout.struct_to_timeout(self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_SNDTIMEO, sizeof_timeval))
 
     def set_socket_read_timeout(self, timeo):
         assert isinstance(timeo, timeout.timeout)