Skip to content

Commit

Permalink
lib-http: http-client-request - Properly reset payload state upon ret…
Browse files Browse the repository at this point in the history
…ry/redirect.
  • Loading branch information
stephanbosch authored and cmouse committed Apr 27, 2020
1 parent d1a0880 commit 799b52a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lib-http/http-client-request.c
Expand Up @@ -1426,6 +1426,8 @@ http_client_request_send_real(struct http_client_request *req, bool pipelined)
iov[2].iov_len = 2;

req->state = HTTP_REQUEST_STATE_PAYLOAD_OUT;
req->payload_finished = FALSE;

req->send_attempts++;
if (req->first_sent_time.tv_sec == 0)
req->first_sent_time = ioloop_timeval;
Expand Down Expand Up @@ -1698,6 +1700,10 @@ http_client_request_reset(struct http_client_request *req, bool rewind,

/* Drop payload output stream from previous attempt */
o_stream_unref(&req->payload_output);

/* Reset payload state */
req->payload_finished = FALSE;

return 0;
}

Expand Down

0 comments on commit 799b52a

Please sign in to comment.