don't try to close connections in web_server.py (to may cause exceptions when using ssl)
This commit is contained in:
@@ -25,22 +25,16 @@ class http_handler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
|||||||
s.send_header("Location", "/test_file")
|
s.send_header("Location", "/test_file")
|
||||||
s.send_header("Connection", "close")
|
s.send_header("Connection", "close")
|
||||||
s.end_headers()
|
s.end_headers()
|
||||||
try: s.finish()
|
|
||||||
except: pass
|
|
||||||
elif s.path == '/infinite_redirect':
|
elif s.path == '/infinite_redirect':
|
||||||
s.send_response(301)
|
s.send_response(301)
|
||||||
s.send_header("Location", "/infinite_redirect")
|
s.send_header("Location", "/infinite_redirect")
|
||||||
s.send_header("Connection", "close")
|
s.send_header("Connection", "close")
|
||||||
s.end_headers()
|
s.end_headers()
|
||||||
try: s.finish()
|
|
||||||
except: pass
|
|
||||||
elif s.path == '/relative/redirect':
|
elif s.path == '/relative/redirect':
|
||||||
s.send_response(301)
|
s.send_response(301)
|
||||||
s.send_header("Location", "../test_file")
|
s.send_header("Location", "../test_file")
|
||||||
s.send_header("Connection", "close")
|
s.send_header("Connection", "close")
|
||||||
s.end_headers()
|
s.end_headers()
|
||||||
try: s.finish()
|
|
||||||
except: pass
|
|
||||||
elif s.path.startswith('/announce'):
|
elif s.path.startswith('/announce'):
|
||||||
s.send_response(200)
|
s.send_response(200)
|
||||||
response = 'd8:intervali1800e8:completei1e10:incompletei1e5:peers0:e'
|
response = 'd8:intervali1800e8:completei1e10:incompletei1e5:peers0:e'
|
||||||
@@ -48,8 +42,6 @@ class http_handler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
|||||||
s.send_header("Connection", "close")
|
s.send_header("Connection", "close")
|
||||||
s.end_headers()
|
s.end_headers()
|
||||||
s.wfile.write(response)
|
s.wfile.write(response)
|
||||||
try: s.finish()
|
|
||||||
except: pass
|
|
||||||
elif os.path.split(s.path)[1].startswith('seed?'):
|
elif os.path.split(s.path)[1].startswith('seed?'):
|
||||||
query = s.path[6:]
|
query = s.path[6:]
|
||||||
args_raw = query.split('&')
|
args_raw = query.split('&')
|
||||||
|
Reference in New Issue
Block a user