From 840eff44f2bea71acaa2a227998a97d01aacdc1f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 16 Oct 2011 01:07:29 +0200 Subject: formdata: ack read callback abort When doing a multipart formpost with a read callback, and that callback returns CURL_READFUNC_ABORT, that return code must be properly propagated back and handled accordingly. Previously it would be handled as a zero byte read which would cause a hang! Added test case 587 to verify. It uses the lib554.c source code with a small ifdef. Reported by: Anton Bychkov Bug: http://curl.haxx.se/mail/lib-2011-10/0097.html --- tests/data/test587 | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 tests/data/test587 (limited to 'tests/data/test587') diff --git a/tests/data/test587 b/tests/data/test587 new file mode 100644 index 000000000..6e1239a6a --- /dev/null +++ b/tests/data/test587 @@ -0,0 +1,51 @@ + +# +# Server-side + + + + + +# Client-side + + +http + +# tool is what to use instead of 'curl' + +lib587 + + + +HTTP multi-part formpost with aborted read callback + + +http://%HOSTIP:%HTTPPORT/587 + + + +# +# Verify data after the test has been "shot" + + +s/^------------------------------[a-z0-9]*/------------------------------/ +s/boundary=----------------------------[a-z0-9]*/boundary=----------------------------/ + + +POST /587 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 732 +Expect: 100-continue +Content-Type: multipart/form-data; boundary=---------------------------- + +------------------------------ +Content-Disposition: form-data; name="sendfile"; filename="postit2.c" + + +# CURLE_ABORTED_BY_CALLBACK (42) + +42 + + + -- cgit v1.2.3