Increase buffer size for file streaming

This commit is contained in:
shortcutme 2017-10-13 01:21:45 +02:00
parent de360a8585
commit d32303de57
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -222,7 +222,7 @@ class Connection(object):
while 1: while 1:
if read_bytes <= 0: if read_bytes <= 0:
break break
buff = self.sock.recv(16 * 1024) buff = self.sock.recv(64 * 1024)
if not buff: if not buff:
break break
buff_len = len(buff) buff_len = len(buff)
@ -402,7 +402,6 @@ class Connection(object):
if streaming: if streaming:
with self.send_lock: with self.send_lock:
bytes_sent = StreamingMsgpack.stream(message, self.sock.sendall) bytes_sent = StreamingMsgpack.stream(message, self.sock.sendall)
message = None
self.bytes_sent += bytes_sent self.bytes_sent += bytes_sent
self.server.bytes_sent += bytes_sent self.server.bytes_sent += bytes_sent
self.server.stat_sent[stat_key]["bytes"] += bytes_sent self.server.stat_sent[stat_key]["bytes"] += bytes_sent