Skip to content

Commit

Permalink
http: fix dead code in setting post client reader
Browse files Browse the repository at this point in the history
- postsize was always 0, thus the check's else never happened
  after the mime client reader was introduced

Follow-up to 0ba4714
Closes curl#13060
  • Loading branch information
icing authored and bagder committed Mar 6, 2024
1 parent cc6f2f0 commit 2ca530d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/http.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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 */
}
Expand Down

0 comments on commit 2ca530d

Please sign in to comment.