Fix HTTP transfers of large payloads

This commit is contained in:
Jeremy Lakeman 2014-06-27 15:07:26 +09:30
parent 186b6cbc2f
commit 804cc93be6
2 changed files with 2 additions and 2 deletions

View File

@ -735,7 +735,7 @@ int rhizome_payload_content(struct http_request *hr, unsigned char *buf, size_t
assert(r->u.read_state.offset < r->u.read_state.length);
uint64_t remain = r->u.read_state.length - r->u.read_state.offset;
size_t readlen = bufsz;
if (remain < bufsz)
if (remain <= bufsz)
readlen = remain;
else
readlen &= ~(blocksz - 1);

View File

@ -425,7 +425,7 @@ bundle_received_by() {
fi
done
restart=true
pop_instance
tfw_nolog pop_instance
;;
--stderr)
for ((i = 0; i < ${#bundles[*]}; ++i)); do