#NEWLINE# def dataReceived( self , bodyBytes ) : #NEWLINE# #INDENT# self . _bodybuf . write ( bodyBytes ) #NEWLINE# self . _bytes_received += len ( bodyBytes ) #NEWLINE# if ( self . _maxsize and ( self . _bytes_received > self . _maxsize ) ) : #NEWLINE# #INDENT# logger . error ( 'Received (%(bytes)s) bytes larger than download max size (%(maxsize)s).' , { #NEWLINE# #INDENT# 'bytes' : self . _bytes_received , #NEWLINE# 'maxsize' : self . _maxsize , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . _finished . cancel ( ) #NEWLINE# #UNINDENT# if ( self . _warnsize and ( self . _bytes_received > self . _warnsize ) and ( not self . _reached_warnsize ) ) : #NEWLINE# #INDENT# self . _reached_warnsize = True #NEWLINE# logger . warning ( 'Received more bytes than download warn size (%(warnsize)s) in request %(request)s.' , { #NEWLINE# #INDENT# 'warnsize' : self . _warnsize , #NEWLINE# 'request' : self . _request , #NEWLINE# #UNINDENT# } )