Changeset 2885


Ignore:
Timestamp:
14/09/07 09:41:25 (12 years ago)
Author:
pjkersha
Message:

ndg.security.common/ndg/security/common/m2CryptoSSLUtility.py:

  • added defReadTimeout and defWriteTimeout class vars
  • and pydoc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/python/ndg.security.common/ndg/security/common/m2CryptoSSLUtility.py

    r2884 r2885  
    116116 
    117117class HTTPSConnection(_HTTPSConnection): 
    118  
     118    """Modified version of M2Crypto equivalent to enable custom checks with 
     119    the peer and timeout settings 
     120     
     121    @type defReadTimeout: M2Crypto.SSL.timeout 
     122    @cvar defReadTimeout: default timeout for read operations 
     123    @type defWriteTimeout: M2Crypto.SSL.timeout 
     124    @cvar defWriteTimeout: default timeout for write operations"""     
     125    defReadTimeout = SSL.timeout(sec=3.) 
     126    defWriteTimeout = SSL.timeout(sec=3.) 
     127     
    119128    def __init__(self, *args, **kw): 
    120129        '''Overload to enable setting of post connection check 
    121         callback to SSL.Connection''' 
     130        callback to SSL.Connection 
     131         
     132        type *args: tuple 
     133        param *args: args which apply to M2Crypto.httpslib.HTTPSConnection 
     134        type **kw: dict 
     135        param **kw: additional keywords - postConnectionCheck - set class for 
     136        checking peer, readTimeout - M2Crypto.SSL.timeout instance - set  
     137        timeout for read, similarly writeTimeout''' 
     138         
    122139        if 'postConnectionCheck' in kw: 
    123140            self._postConnectionCheck = kw['postConnectionCheck'] 
     
    133150            del kw['readTimeout'] 
    134151        else: 
    135             self.readTimeout = SSL.timeout(sec=3.)  
     152            self.readTimeout = HTTPSConnection.defReadTimeout 
    136153               
    137154        if 'writeTimeout' in kw: 
     
    142159            del kw['writeTimeout'] 
    143160        else: 
    144             self.writeTimeout = SSL.timeout(sec=3.) 
     161            self.writeTimeout = HTTPSConnection.defWriteTimeout 
    145162             
    146163        _HTTPSConnection.__init__(self, *args, **kw) 
Note: See TracChangeset for help on using the changeset viewer.