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

Method onResponseBodyData

Libraries/Http/HttpAsyncClient.cpp:822–846  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

820
821 if (response.isBodyComplete())
822 {
823 finishResponse();
824 return;
825 }
826
827 const bool addedBodyData = connection->getReadableTransportStream()
828 .eventData.addListener<HttpAsyncClient, &HttpAsyncClient::onResponseBodyData>(*this);
829 SC_HTTP_ASSERT_RELEASE(addedBodyData);
830 state = State::StreamingResponse;
831}
832
833void HttpAsyncClient::onResponseBodyData(AsyncBufferView::ID bufferID)
834{
835 Span<const char> readData;
836 Result readable = connection->buffersPool.getReadableData(bufferID, readData);
837 if (not readable)
838 {
839 fail(readable);
840 return;
841 }
842
843 Result process = response.processBodyData(connection->getReadableTransportStream(), bufferID, readData, false);
844 if (not process)
845 {
846 fail(process);
847 return;
848 }
849 if (response.isBodyComplete())

Callers

nothing calls this directly

Calls 2

getReadableDataMethod · 0.80
processBodyDataMethod · 0.80

Tested by

no test coverage detected