/usr/share/pyshared/M2Crypto/SSL/timeout.py is in python-m2crypto 0.21.1-2ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | """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')
|