<s> import dshell <EOL> import util <EOL> from httpdecoder import HTTPDecoder <EOL> class DshellDecoder ( HTTPDecoder ) : <EOL> '''<STR_LIT>''' <EOL> def __init__ ( self ) : <EOL> HTTPDecoder . __init__ ( self , <EOL> name = '<STR_LIT>' , <EOL> description = '<STR_LIT>' , <EOL> longdescription = '''<STR_LIT>''' , <EOL> filter = '<STR_LIT>' , <EOL> filterfn = lambda ( ( sip , sp ) , ( dip , dp ) ) : sp in ( <EOL> <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) or dp in ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) , <EOL> author = '<STR_LIT>' , <EOL> ) <EOL> def HTTPHandler ( self , conn , request , response , requesttime , responsetime ) : <EOL> if response == None : <EOL> try : <EOL> rangestr = util . getHeader ( request , '<STR_LIT>' ) <EOL> if not rangestr . endswith ( '<STR_LIT>' ) : return <EOL> except : return <EOL> self . alert ( '<STR_LIT>' % ( request . method , request . uri , rangestr ) , conn . info ( ) ) <EOL> else : <EOL> try : <EOL> rangestr = util . getHeader ( request , '<STR_LIT>' ) <EOL> if not rangestr . endswith ( '<STR_LIT>' ) : return <EOL> except : return <EOL> if rangestr and ( response . status == '<STR_LIT>' or response . reason == '<STR_LIT>' ) : <EOL> self . alert ( '<STR_LIT>' % <EOL> ( request . method , rangestr ) , conn . info ( ) ) <EOL> if request . method != '<STR_LIT:GET>' : <EOL> pass <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> dObj = DshellDecoder ( ) <EOL> print dObj <EOL> else : <EOL> dObj = DshellDecoder ( ) </s>
