Skip to content

Commit

Permalink
Better logging for #334 #6446
Browse files Browse the repository at this point in the history
  • Loading branch information
andresriancho committed Feb 5, 2015
1 parent 3269453 commit 736c8e3
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions w3af/core/controllers/daemons/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
"""
import SocketServer
import cStringIO
import threading
import traceback
import httplib
import socket
import select
import httplib
import time
import os
import SocketServer


from OpenSSL import SSL
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
Expand Down Expand Up @@ -527,7 +529,6 @@ class ProxyServer(HTTPServer, SocketServer.ThreadingMixIn):
"""
I want to use threads to handle all requests.
"""

def serve_forever(self):
"""Handle one request at a time until stopped."""
self.stop = False
Expand All @@ -541,6 +542,16 @@ def serve_forever(self):
msg = 'Exiting proxy server serve_forever(); stop() was successful.'
om.out.debug(msg)

def process_request(self, request, client_address):
"""
Start a new thread to process the request.
"""
t = threading.Thread(target=self.process_request_thread,
args=(request, client_address),
name='ProxyServerWorker')
t.daemon = True
t.start()

def server_bind(self):
msg = 'Changing socket options of ProxyServer to (socket.SOL_SOCKET,'\
' socket.SO_REUSEADDR, 1)'
Expand Down

0 comments on commit 736c8e3

Please sign in to comment.