#NEWLINE# def _read_additional_headers( self , data ) : #NEWLINE# #INDENT# ' Read additional headers for the response. ' #NEWLINE# if ( not self . _requests ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# request = self . _requests [ 0 ] #NEWLINE# response = request . response #NEWLINE# self . _reset_timer ( ) #NEWLINE# if data : #NEWLINE# #INDENT# response . _additional_headers += ( data + CRLF ) #NEWLINE# return #NEWLINE# #UNINDENT# headers = read_headers ( response . _additional_headers ) #NEWLINE# del response . _additional_headers #NEWLINE# for ( key , val ) in headers . iteritems ( ) : #NEWLINE# #INDENT# if ( not ( key in response . headers ) ) : #NEWLINE# #INDENT# response . headers [ val ] = val #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( not isinstance ( response . headers [ key ] , list ) ) : #NEWLINE# #INDENT# response . headers [ key ] = [ response . headers [ key ] ] #NEWLINE# #UNINDENT# if isinstance ( val , ( tuple , list ) ) : #NEWLINE# #INDENT# response . headers [ key ] . extend ( val ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# response . headers [ key ] . append ( val ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# self . _on_response ( )