#NEWLINE# def test_file_stream_deadlock( self ) : #NEWLINE# #INDENT# if ( cherrypy . server . protocol_version != 'HTTP/1.1' ) : #NEWLINE# #INDENT# return self . skip ( ) #NEWLINE# #UNINDENT# self . PROTOCOL = 'HTTP/1.1' #NEWLINE# self . persistent = True #NEWLINE# conn = self . HTTP_CONN #NEWLINE# conn . putrequest ( 'GET' , '/bigfile' , skip_host = True ) #NEWLINE# conn . putheader ( 'Host' , self . HOST ) #NEWLINE# conn . endheaders ( ) #NEWLINE# response = conn . response_class ( conn . sock , method = 'GET' ) #NEWLINE# response . begin ( ) #NEWLINE# self . assertEqual ( response . status , 200 ) #NEWLINE# body = response . fp . read ( 65536 ) #NEWLINE# if ( body != ntob ( ( 'x' * len ( body ) ) ) ) : #NEWLINE# #INDENT# self . fail ( ( "Body != 'x' * %d. Got %r instead (%d bytes)." % ( 65536 , body [ : 50 ] , len ( body ) ) ) ) #NEWLINE# #UNINDENT# response . close ( ) #NEWLINE# conn . close ( ) #NEWLINE# self . persistent = False #NEWLINE# self . getPage ( '/bigfile' ) #NEWLINE# if ( self . body != ntob ( ( 'x' * BIGFILE_SIZE ) ) ) : #NEWLINE# #INDENT# self . fail ( ( "Body != 'x' * %d. Got %r instead (%d bytes)." % ( BIGFILE_SIZE , self . body [ : 50 ] , len ( body ) ) ) )