aboutsummaryrefslogtreecommitdiff
path: root/lib/http.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2010-10-20 14:57:43 +0200
committerDaniel Stenberg <daniel@haxx.se>2010-10-20 14:57:43 +0200
commite8c442952d53d493e347a784d53d602359b4331c (patch)
tree55badc6bfb21ea296aa795ac6ab2d8cef0bd376e /lib/http.c
parent98d9dc78407eff15ebf566fe08df2e1b4fd18baf (diff)
formdata: provide error message
When failing to build form post due to an error, the code now does a proper failf(). Previously libcurl would report an error like "failed creating formpost data" when a file wasn't possible to open which was not easy for users to figure out. I also lower cased a function name to be named more curl-style and removed some unnecessary code.
Diffstat (limited to 'lib/http.c')
-rw-r--r--lib/http.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/lib/http.c b/lib/http.c
index 413ef3d89..ed0730c0a 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -2375,19 +2375,15 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
#endif /* CURL_DISABLE_PROXY */
if(HTTPREQ_POST_FORM == httpreq) {
- /* we must build the whole darned post sequence first, so that we have
- a size of the whole shebang before we start to send it */
- result = Curl_getFormData(&http->sendit, data->set.httppost,
- Curl_checkheaders(data, "Content-Type:"),
- &http->postsize);
- if(CURLE_OK != result) {
- /* Curl_getFormData() doesn't use failf() */
- failf(data, "failed creating formpost data");
- return result;
- }
+ /* we must build the whole post sequence first, so that we have a size of
+ the whole transfer before we start to send it */
+ result = Curl_getformdata(data, &http->sendit, data->set.httppost,
+ Curl_checkheaders(data, "Content-Type:"),
+ &http->postsize);
+ if(result)
+ return result;
}
-
http->p_accept = Curl_checkheaders(data, "Accept:")?NULL:"Accept: */*\r\n";
if(( (HTTPREQ_POST == httpreq) ||