Skip to content

Commit

Permalink
lib-http: client: Fixed assert failure occurring when server returns …
Browse files Browse the repository at this point in the history
…error status early while client is still sending blocking payload.
  • Loading branch information
stephanbosch authored and GitLab committed Nov 9, 2016
1 parent 8e2dd12 commit b284962
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/lib-http/http-client-request.c
Original file line number Diff line number Diff line change
Expand Up @@ -821,10 +821,16 @@ int http_client_request_send_payload(struct http_client_request **_req,
i_assert(data != NULL);

ret = http_client_request_continue_payload(&req, data, size);
if (ret < 0)
if (ret < 0) {
/* failed to send payload */
*_req = NULL;
else {
i_assert(ret == 0);
} else if (ret > 0) {
/* premature end of request;
server sent error before all payload could be sent */
ret = -1;
*_req = NULL;
} else {
/* not finished sending payload */
i_assert(req != NULL);
}
return ret;
Expand Down

0 comments on commit b284962

Please sign in to comment.