#NEWLINE# def _forward_request( self , request ) : #NEWLINE# #INDENT# if request : #NEWLINE# #INDENT# if ( ( not request . drop_connection ) and ( not request . reset_connection ) ) : #NEWLINE# #INDENT# clientFactory = self . proxyClientFactoryClass ( self . method , self . uri , self . clientproto , self . getAllHeaders ( ) , self . content . read ( ) , request ) #NEWLINE# self . reactor . connectTCP ( self . upstream_host , self . upstream_port , clientFactory ) #NEWLINE# log . msg ( ( ( ( 'Forwarding request to: ' + str ( self . upstream_host ) ) + ':' ) + str ( self . upstream_port ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if request . drop_connection : #NEWLINE# #INDENT# request . transport . loseConnection ( ) #NEWLINE# log . msg ( ( ( ( ( 'Connection to: ' + str ( self . upstream_host ) ) + ':' ) + str ( self . upstream_port ) ) + ' dropped' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# request . transport . abortConnection ( ) #NEWLINE# log . msg ( ( ( ( ( 'Connection to: ' + str ( self . upstream_host ) ) + ':' ) + str ( self . upstream_port ) ) + ' reset' ) )