Changeset 8099


Ignore:
Timestamp:
20/08/12 11:43:29 (7 years ago)
Author:
pjkersha
Message:
  • fix to ssl_socket makefile method and utils _should_use_proxy
Location:
trunk/ndg_httpsclient/ndg/httpsclient
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ndg_httpsclient/ndg/httpsclient/ssl_socket.py

    r8096 r8099  
    217217        return self.__ssl_conn.state_string() 
    218218 
    219     def _DEPRECATE_makefile(self, *args): 
     219    def makefile(self, *args): 
    220220        """Specific to Python socket API and required by httplib: convert 
    221221        response into a file-like object.  This implementation reads using recv 
     
    231231        @rtype: cStringIO.StringO 
    232232        """ 
     233        self._makefile_refs += 1 
     234         
    233235        # Optimisation 
    234236        _buf_size = self.buf_size 
     
    261263        return stream 
    262264 
    263     def makefile(self, mode='r', bufsize=-1): 
    264  
    265         """Make and return a file-like object that 
    266         works with the SSL connection.  Just use the code 
    267         from the socket module.""" 
    268  
    269         self._makefile_refs += 1 
    270         # close=True so as to decrement the reference count when done with 
    271         # the file-like object. 
    272         return socket._fileobject(self.socket, mode, bufsize, close=True) 
     265#    def makefile(self, mode='r', bufsize=-1): 
     266# 
     267#        """Make and return a file-like object that 
     268#        works with the SSL connection.  Just use the code 
     269#        from the socket module.""" 
     270# 
     271#        self._makefile_refs += 1 
     272#        # close=True so as to decrement the reference count when done with 
     273#        # the file-like object. 
     274#        return socket._fileobject(self.socket, mode, bufsize, close=True) 
    273275     
    274276    def getsockname(self): 
  • trunk/ndg_httpsclient/ndg/httpsclient/utils.py

    r8096 r8099  
    187187 
    188188 
    189 def _should_use_proxy(url, no_proxy): 
     189def _should_use_proxy(url, no_proxy=None): 
    190190    """Determines whether a proxy should be used to open a connection to the  
    191191    specified URL, based on the value of the no_proxy environment variable. 
Note: See TracChangeset for help on using the changeset viewer.