| 456 | { |
| 457 | SC_TRY(request.end()); |
| 458 | } |
| 459 | } |
| 460 | else |
| 461 | { |
| 462 | SC_TRY_MSG(request.hasSentHeaders(), "HttpAsyncClient request headers not sent"); |
| 463 | } |
| 464 | |
| 465 | state = State::WaitingResponse; |
| 466 | return Result(true); |
| 467 | } |
| 468 | |
| 469 | Result HttpAsyncClient::validateActiveRequest() const |
| 470 | { |
| 471 | if (request.hasTransferEncodingHeader() and not request.usesChunkedTransferEncoding()) |
| 472 | { |
| 473 | return Result::Error("HttpAsyncClient does not support Transfer-Encoding request headers"); |
| 474 | } |
| 475 | |
| 476 | if (request.getBodyType() == HttpAsyncClientRequest::BodyType::Stream) |
| 477 | { |
| 478 | SC_TRY_MSG(request.getBodyStream() != nullptr, "HttpAsyncClient body stream missing"); |
| 479 | SC_TRY_MSG(&request.getBodyStream()->getBuffersPool() == &connection->buffersPool, |
| 480 | "HttpAsyncClient body stream must use the client buffers pool"); |
| 481 | if (request.getBodyTransform() != nullptr) |
| 482 | { |
| 483 | SC_TRY_MSG(&request.getBodyTransform()->AsyncReadableStream::getBuffersPool() == &connection->buffersPool, |
| 484 | "HttpAsyncClient body transform readable side must use the client buffers pool"); |
| 485 | SC_TRY_MSG(&request.getBodyTransform()->AsyncWritableStream::getBuffersPool() == &connection->buffersPool, |
| 486 | "HttpAsyncClient body transform writable side must use the client buffers pool"); |
| 487 | } |
| 488 | } |
nothing calls this directly
no test coverage detected