Ejemplo n.º 1
0
    def __init__(self, server, options, sessionFactory):
        FlowMaster.__init__(self, server, flow.State())        
        
        self.sessionFactory = sessionFactory
        self.o = options
        self.flows = FlowCollection()
        self.anticache = options.anticache
        self.anticomp = options.anticomp
            
        if options.stickycookie:
            self.set_stickycookie(options.stickycookie)

        if options.stickyauth:
            self.set_stickyauth(options.stickyauth)

        if options.wfile:
            path = os.path.expanduser(options.wfile)
            directory = os.path.split(path)[0]
            if not os.path.exists(directory):
                os.makedirs(directory)
            try:
                f = file(path, "wb")
                self.fwriter = flow.FlowWriter(f)
            except IOError, v:
                raise Exception(v.strerror)
Ejemplo n.º 2
0
    def __init__(self, server, options, sessionFactory):
        FlowMaster.__init__(self, server, flow.State())

        self.sessionFactory = sessionFactory
        self.o = options
        self.flows = FlowCollection()
        self.anticache = options.anticache
        self.anticomp = options.anticomp

        if options.stickycookie:
            self.set_stickycookie(options.stickycookie)

        if options.stickyauth:
            self.set_stickyauth(options.stickyauth)

        if options.wfile:
            path = os.path.abspath(os.path.expanduser(options.wfile))
            directory = os.path.split(path)[0]
            if not os.path.exists(directory):
                os.makedirs(directory)
            try:
                f = file(path, "wb")
                self.fwriter = flow.FlowWriter(f)
            except IOError, v:
                raise Exception(v.strerror)
Ejemplo n.º 3
0
 def handle_request(self, request):
     flow = FlowMaster.handle_request(self, request)
     
     if flow:
         request._ack()
         #print "request to "+request.host
         #self.sessionFactory.write(request.host)
         
     return flow
Ejemplo n.º 4
0
    def handle_request(self, request):
        flow = FlowMaster.handle_request(self, request)

        if flow:
            request.reply()
            #print "request to "+request.host
            #self.sessionFactory.write(request.host)

        return flow
Ejemplo n.º 5
0
 def handle_response(self, response):
     flow = FlowMaster.handle_response(self, response)
     
     if flow:
         response._ack()
         flowId = self.flows.addFlow(flow)
         if self.o.wfile:
             self.fwriter.add(flow)
         if self.o.dumpdir:
             self.dirdumper.add(flow)
         #print "response from "+flow.request.host
         self.sessionFactory.onNewFlow(self.flows.getFlowsSerialized()[flowId])
         
     return flow
Ejemplo n.º 6
0
    def handle_response(self, response):
        flow = FlowMaster.handle_response(self, response)

        if flow:
            response.reply()
            flowId = self.flows.addFlow(flow)
            if self.o.wfile:
                self.fwriter.add(flow)
            if self.o.dumpdir:
                self.dirdumper.add(flow)
            #print "response from "+flow.request.host
            self.sessionFactory.onNewFlow(
                self.flows.getFlowsSerialized()[flowId])

        return flow
Ejemplo n.º 7
0
 def shutdown(self):
     if(self.o.wfile):
         self.fwriter.fo.close()
     return FlowMaster.shutdown(self)
Ejemplo n.º 8
0
 def shutdown(self):
     if (self.o.wfile):
         self.fwriter.fo.close()
     return FlowMaster.shutdown(self)