When the request payload is finished, both req->payload_input and
req->payload_output could be NULL, so the assertions on those being not NULL
need to happen after the check for req->payload_finished.
This particularly causes problems with the
blocking http_client_request_send/finish_payload() API, which constantly
modifies req->payload_input and sets it to NULL to finish the output.
This caused a panic:
Panic: file http-client-request.c: line 1232 (http_client_request_send_more): assertion failed: (req->payload_input != NULL)
const char *error;
uoff_t offset;
- i_assert(req->payload_input != NULL);
- i_assert(req->payload_output != NULL);
-
if (req->payload_finished)
return http_client_request_finish_payload_out(req);
+ i_assert(req->payload_input != NULL);
+ i_assert(req->payload_output != NULL);
+
io_remove(&conn->io_req_payload);
/* Chunked ostream needs to write to the parent stream's buffer */