From 70e2aadc18fce9f6e3b9c06612c8314bf4f710b1 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 23 Apr 2004 10:37:52 +0000 Subject: 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 --- lib/http.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'lib/http.c') 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; } -- cgit v1.2.3