MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / operator()

Method operator()

Libraries/Http/HttpAsyncServer.cpp:273–310  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

271
272void HttpAsyncServer::onTransportSetupComplete(HttpConnection& client, Result result)
273{
274 if (not result)
275 {
276 if (onError.isValid())
277 {
278 onError(result);
279 }
280 closeAsync(client);
281 return;
282 }
283
284 Result setup = beginHttpConnection(client);
285 if (not setup)
286 {
287 if (onError.isValid())
288 {
289 onError(setup);
290 }
291 closeAsync(client);
292 }
293}
294
295void HttpAsyncServer::onStreamReceive(HttpConnection& client, AsyncBufferView::ID bufferID)
296{
297 Span<char> readData;
298 SC_HTTP_ASSERT_RELEASE(client.buffersPool.getWritableData(bufferID, readData));
299
300 Result headerWrite =
301 client.request.writeHeaders(maxHeaderSize, readData, client.getReadableTransportStream(), bufferID);
302 if (not headerWrite)
303 {
304 if (onError.isValid())
305 {
306 onError(headerWrite);
307 }
308 closeAsync(client);
309 return;
310 }
311 else if (client.request.hasReceivedHeaders())
312 {
313 client.response.grabUnusedHeaderMemory(client.request);

Callers

nothing calls this directly

Calls 7

isEndedMethod · 0.80
setHeaderMemoryMethod · 0.80
resumeReadingMethod · 0.80
isValidMethod · 0.45
resetMethod · 0.45
initMethod · 0.45
closeAsyncMethod · 0.45

Tested by

no test coverage detected