#NEWLINE# def _process( self ) : #NEWLINE# #INDENT# ' Send the first request on the stack. ' #NEWLINE# if ( not self . _requests ) : #NEWLINE# #INDENT# if self . _stream : #NEWLINE# #INDENT# self . _want_close = True #NEWLINE# self . _no_process = True #NEWLINE# self . _stream . close ( False ) #NEWLINE# self . _stream = None #NEWLINE# #UNINDENT# self . _processing = False #NEWLINE# return #NEWLINE# #UNINDENT# self . _processing = True #NEWLINE# request = self . _requests [ 0 ] #NEWLINE# if ( not request . response ) : #NEWLINE# #INDENT# HTTPResponse ( request ) #NEWLINE# #UNINDENT# if ( request . auth and ( not isinstance ( request . auth , ( list , tuple ) ) ) ) : #NEWLINE# #INDENT# request = request . auth ( request ) #NEWLINE# #UNINDENT# port = _port ( request . url ) #NEWLINE# is_secure = ( request . url . scheme == 'https' ) #NEWLINE# if ( not port ) : #NEWLINE# #INDENT# port = ( 443 if is_secure else 80 ) #NEWLINE# #UNINDENT# host = ( '%s:%d' % ( _hostname ( request . url ) , port ) ) #NEWLINE# if self . _stream : #NEWLINE# #INDENT# if ( not self . _stream . connected ) : #NEWLINE# #INDENT# self . _stream = None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( self . _ssl_options != request . session . ssl_options ) or ( not self . _stream . can_fetch ( host , is_secure ) ) ) : #NEWLINE# #INDENT# log . debug ( ( 'Closing unusable stream for %r.' % self ) ) #NEWLINE# self . _want_close = True #NEWLINE# self . _no_process = False #NEWLINE# self . _stream . close ( False ) #NEWLINE# return #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# log . debug ( ( 'Sending HTTP request %r.' % request ) ) #NEWLINE# self . _reset_timer ( ) #NEWLINE# if ( not self . _stream ) : #NEWLINE# #INDENT# self . _stream = _HTTPStream ( self , engine = self . engine ) #NEWLINE# #UNINDENT# if ( is_secure and ( not self . _stream . ssl_enabled ) ) : #NEWLINE# #INDENT# self . _ssl_options = request . session . ssl_options #NEWLINE# self . _stream . startSSL ( ( self . _ssl_options or { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) ) #NEWLINE# #UNINDENT# self . _stream . connect ( ( _hostname ( request . url ) , port ) )