#NEWLINE# def _on_close( self ) : #NEWLINE# #INDENT# "\n        If we weren't expecting the stream to close, it's an error, otherwise,\n        just process our requests.\n        " #NEWLINE# if self . _reading_forever : #NEWLINE# #INDENT# self . _reading_forever = False #NEWLINE# if self . _requests : #NEWLINE# #INDENT# request = self . _requests [ 0 ] #NEWLINE# response = request . response #NEWLINE# if response . _decoder : #NEWLINE# #INDENT# response . _receive ( response . _decoder . flush ( ) ) #NEWLINE# response . _receive ( response . _decoder . unused_data ) #NEWLINE# response . _decoder = None #NEWLINE# #UNINDENT# self . _want_close = False #NEWLINE# self . _no_process = False #NEWLINE# self . _on_response ( ) #NEWLINE# return #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( not self . _want_close ) : #NEWLINE# #INDENT# self . _want_close = False #NEWLINE# if self . _requests : #NEWLINE# #INDENT# request = self . _requests [ 0 ] #NEWLINE# self . _no_process = False #NEWLINE# self . _do_error ( RequestClosed ( 'The server closed the connection.' ) ) #NEWLINE# return #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# self . _stream = None #NEWLINE# if request . _no_process : #NEWLINE# #INDENT# self . _no_process = False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . _process ( )