#NEWLINE# def rewrite_response( resp ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# while True : #NEWLINE# #INDENT# parser = HttpStream ( resp ) #NEWLINE# for data in parser : #NEWLINE# #INDENT# resp . writeall ( data ) #NEWLINE# #UNINDENT# if ( not parser . should_keep_alive ( ) ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# except ( socket . error , NoMoreData ) : #NEWLINE# #INDENT# pass