]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
http: fix dead code in setting post client reader
authorStefan Eissing <stefan@eissing.org>
Wed, 6 Mar 2024 11:09:05 +0000 (12:09 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 6 Mar 2024 13:35:23 +0000 (14:35 +0100)
- postsize was always 0, thus the check's else never happened
  after the mime client reader was introduced

Follow-up to 0ba47146f7ff3d
Closes #13060

lib/http.c

index 88746eb579ca210bee8dab6f969094ef0462a4a3..d50b099c77ebfc59033f05e8d94cf8008b5fc987 100644 (file)
@@ -1997,7 +1997,6 @@ CURLcode Curl_http_target(struct Curl_easy *data,
 #if !defined(CURL_DISABLE_MIME) || !defined(CURL_DISABLE_FORM_API)
 static CURLcode set_post_reader(struct Curl_easy *data, Curl_HttpReq httpreq)
 {
-  curl_off_t postsize = 0;
   CURLcode result;
 
   switch(httpreq) {
@@ -2066,12 +2065,9 @@ static CURLcode set_post_reader(struct Curl_easy *data, Curl_HttpReq httpreq)
     }
     data->state.infilesize = Curl_creader_total_length(data);
     return result;
+
   default:
-    if(!postsize)
-      result = Curl_creader_set_null(data);
-    else
-      result = Curl_creader_set_fread(data, postsize);
-    return result;
+    return Curl_creader_set_null(data);
   }
   /* never reached */
 }