diff options
author | Daniel Stenberg <daniel@haxx.se> | 2004-04-23 10:37:52 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2004-04-23 10:37:52 +0000 |
commit | 70e2aadc18fce9f6e3b9c06612c8314bf4f710b1 (patch) | |
tree | 2bb2451e6dff724f0488c7d62eecd8c107f2e642 /lib/http.c | |
parent | a1c8aaf666ac64ac3a09bfff1f6eb4b6facfc953 (diff) |
Replaced Curl_FormReadOneLine with Curl_formpostheader as that is the only use
for it. It saves one extra copy of the header.
I also added comments for several functions in formdata.c
Diffstat (limited to 'lib/http.c')
-rw-r--r-- | lib/http.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/http.c b/lib/http.c index 0c81752d3..1e95e1083 100644 --- a/lib/http.c +++ b/lib/http.c @@ -1686,7 +1686,7 @@ CURLcode Curl_http(struct connectdata *conn) } if(!checkheaders(data, "Content-Type:")) { - /* Get Content-Type: line from Curl_FormReadOneLine, which happens + /* Get Content-Type: line from Curl_formpostheader, which happens to always be the first line. We can know this for sure since we always build the formpost linked list the same way! @@ -1694,13 +1694,11 @@ CURLcode Curl_http(struct connectdata *conn) string etc why disabling this header is likely to not make things work, but we support it anyway. */ - char contentType[256]; + char *contentType; size_t linelength=0; - linelength = Curl_FormReadOneLine(contentType, - sizeof(contentType), - 1, - (FILE *)&http->form); - if(!linelength) { + contentType = Curl_formpostheader((void *)&http->form, + &linelength); + if(!contentType) { failf(data, "Could not get Content-Type header line!"); return CURLE_HTTP_POST_ERROR; } |