MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / validateActiveRequest

Method validateActiveRequest

Libraries/Http/HttpAsyncClient.cpp:458–485  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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
469Result 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 }

Callers

nothing calls this directly

Calls 4

getBoundaryMethod · 0.80
ErrorEnum · 0.50
ResultClass · 0.50
sizeInBytesMethod · 0.45

Tested by

no test coverage detected