MCPcopy Create free account
hub / github.com/SmingHub/Sming / onBody

Method onBody

Sming/Components/Network/src/Network/Http/HttpClientConnection.cpp:212–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210}
211
212int HttpClientConnection::onBody(const char* at, size_t length)
213{
214 if(incomingRequest == nullptr) {
215 // nothing to process right now...
216 return 1;
217 }
218
219 if(incomingRequest->requestBodyDelegate) {
220 return incomingRequest->requestBodyDelegate(*this, at, length);
221 }
222
223 if(response.buffer != nullptr) {
224 auto res = response.buffer->write((const uint8_t*)at, length);
225 if(res != length) {
226 // unable to write the requested bytes - stop here...
227 response.freeStreams();
228 return 1;
229 }
230 }
231
232 return 0;
233}
234
235void HttpClientConnection::onReadyToSendData(TcpConnectionEvent sourceEvent)
236{

Callers 1

staticOnBodyMethod · 0.45

Calls 2

writeMethod · 0.45
freeStreamsMethod · 0.45

Tested by

no test coverage detected