mirror of
https://github.com/gnh1201/caterpillar.git
synced 2025-09-06 01:41:00 +00:00
Update server.py
This commit is contained in:
parent
a7f0ffb03d
commit
2002bd3739
|
@ -217,7 +217,7 @@ def proxy_server(webserver, port, scheme, method, url, conn, addr, data):
|
|||
raise Exception("SSL negotiation failed. (%s:%s) %s" % (webserver.decode(client_encoding), str(port), str(e)))
|
||||
|
||||
# Wait to see if there is more data to transmit
|
||||
def sendall(sock, data):
|
||||
def sendall(sock, conn, data):
|
||||
# send first chuck
|
||||
sock.send(data)
|
||||
if len(data) < buffer_size:
|
||||
|
@ -252,11 +252,11 @@ def proxy_server(webserver, port, scheme, method, url, conn, addr, data):
|
|||
sock = context.wrap_socket(sock, server_hostname=webserver.decode(client_encoding))
|
||||
sock.connect((webserver, port))
|
||||
#sock.sendall(data)
|
||||
sendall(sock, data)
|
||||
sendall(sock, conn, data)
|
||||
else:
|
||||
sock.connect((webserver, port))
|
||||
#sock.sendall(data)
|
||||
sendall(sock, data)
|
||||
sendall(sock, conn, data)
|
||||
|
||||
i = 0
|
||||
buffered = b''
|
||||
|
|
Loading…
Reference in New Issue
Block a user