mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 09:16:38 -04:00
decrease chunk size to 32k due to crappy win32 network cards
This commit is contained in:
parent
11c1e7799b
commit
75f56d13e2
1 changed files with 4 additions and 4 deletions
|
@ -72,7 +72,7 @@ def incrementalSend(self, strOrFile):
|
||||||
while 1:
|
while 1:
|
||||||
if sendProgressHook:
|
if sendProgressHook:
|
||||||
sendProgressHook(cnt)
|
sendProgressHook(cnt)
|
||||||
data = strOrFile.read(65536)
|
data = strOrFile.read(32768)
|
||||||
cnt += len(data)
|
cnt += len(data)
|
||||||
if not data:
|
if not data:
|
||||||
break
|
break
|
||||||
|
@ -965,7 +965,7 @@ and cards.id in %s""" % ids2str([c[0] for c in cards])))
|
||||||
# data
|
# data
|
||||||
comp = zlib.compressobj()
|
comp = zlib.compressobj()
|
||||||
while 1:
|
while 1:
|
||||||
data = src.read(65536)
|
data = src.read(32768)
|
||||||
if not data:
|
if not data:
|
||||||
tmp.write(comp.flush())
|
tmp.write(comp.flush())
|
||||||
break
|
break
|
||||||
|
@ -1003,12 +1003,12 @@ and cards.id in %s""" % ids2str([c[0] for c in cards])))
|
||||||
decomp = zlib.decompressobj()
|
decomp = zlib.decompressobj()
|
||||||
cnt = 0
|
cnt = 0
|
||||||
while 1:
|
while 1:
|
||||||
data = src.read(65536)
|
data = src.read(32768)
|
||||||
if not data:
|
if not data:
|
||||||
tmp.write(decomp.flush())
|
tmp.write(decomp.flush())
|
||||||
break
|
break
|
||||||
tmp.write(decomp.decompress(data))
|
tmp.write(decomp.decompress(data))
|
||||||
cnt += 65536
|
cnt += 32768
|
||||||
runHook("fullSyncProgress", "fromServer", cnt)
|
runHook("fullSyncProgress", "fromServer", cnt)
|
||||||
src.close()
|
src.close()
|
||||||
tmp.close()
|
tmp.close()
|
||||||
|
|
Loading…
Reference in a new issue