]> git.ipfire.org Git - thirdparty/curl.git/commit
mime: latch last read callback status.
authorPatrick Monnerat <patrick@monnerat.net>
Fri, 6 Mar 2020 08:46:39 +0000 (09:46 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 7 Mar 2020 22:26:00 +0000 (23:26 +0100)
commit96972ec1c00a142e3859efc82a06b0b810527da2
treeb87cf6005d4815ee0ab7ff33f4e9d320e0d1cdad
parent3dce9849be4f84df83ba342be24ce29f4fbe01d4
mime: latch last read callback status.

In case a read callback returns a status (pause, abort, eof,
error) instead of a byte count, drain the bytes read so far but
remember this status for further processing.
Takes care of not losing data when pausing, and properly resume a
paused mime structure when requested.
New tests 670-673 check unpausing cases, with easy or multi
interface and mime or form api.

Fixes #4813
Reported-by: MrdUkk on github
13 files changed:
lib/easy.c
lib/formdata.c
lib/mime.c
lib/mime.h
tests/data/Makefile.inc
tests/data/test644
tests/data/test670 [new file with mode: 0644]
tests/data/test671 [new file with mode: 0644]
tests/data/test672 [new file with mode: 0644]
tests/data/test673 [new file with mode: 0644]
tests/libtest/Makefile.inc
tests/libtest/lib643.c
tests/libtest/lib670.c [new file with mode: 0644]