]> git.ipfire.org Git - thirdparty/curl.git/commit
transfer: Fix chunked-encoding upload bug
authorJay Satiro <raysatiro@yahoo.com>
Tue, 24 Oct 2017 20:08:26 +0000 (16:08 -0400)
committerJay Satiro <raysatiro@yahoo.com>
Thu, 26 Oct 2017 18:34:46 +0000 (14:34 -0400)
commit979d2877be3647bef52e19a38f27346866a66bea
treea5ef2aa18bd70ec1a68d4d42bfc2dfcc3fd28965
parent788d3335734b24f4f15045989d1ce75d18e98961
transfer: Fix chunked-encoding upload bug

- When uploading via chunked-encoding don't compare file size to bytes
  sent to determine whether the upload has finished.

Chunked-encoding adds its own overhead which why the bytes sent is not
equal to the file size. Prior to this change if a file was uploaded in
chunked-encoding and its size was known it was possible that the upload
could end prematurely without sending the final few chunks. That would
result in a server hang waiting for the remaining data, likely followed
by a disconnect.

The scope of this bug is limited to some arbitrary file sizes which have
not been determined. One size that triggers the bug is 475020.

Bug: https://github.com/curl/curl/issues/2001
Reported-by: moohoorama@users.noreply.github.com
Closes https://github.com/curl/curl/pull/2010
lib/transfer.c