| Server IP : 172.67.216.113 / Your IP : 104.23.243.33 [ Web Server : Apache System : Linux cpanel01wh.bkk1.cloud.z.com 2.6.32-954.3.5.lve1.4.59.el6.x86_64 #1 SMP Thu Dec 6 05:11:00 EST 2018 x86_64 User : cp648411 ( 1354) PHP Version : 7.2.34 Disable Function : NONE Domains : 0 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /usr/lib64/python2.6/site-packages/M2Crypto/SSL/ |
Upload File : |
"""Support for SSL socket timeouts.
Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.
Copyright 2008 Heikki Toivonen. All rights reserved.
"""
__all__ = ['DEFAULT_TIMEOUT', 'timeout', 'struct_to_timeout', 'struct_size']
import struct
from M2Crypto import m2
DEFAULT_TIMEOUT = 600
class timeout:
def __init__(self, sec=DEFAULT_TIMEOUT, microsec=0):
self.sec = sec
self.microsec = microsec
def pack(self):
return struct.pack('ll', self.sec, self.microsec)
def struct_to_timeout(binstr):
(s, ms) = struct.unpack('ll', binstr)
return timeout(s, ms)
def struct_size():
return struct.calcsize('ll')