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

Method startSendingHeaders

Tests/Libraries/Http/HttpTestClient.cpp:296–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

294}
295
296void SC::HttpTestClient::startSendingHeaders(AsyncSocketConnect::Result& result)
297{
298 (void)(result);
299
300 Span<const char> toSend;
301 if (headerBytes < content.size() and bodyDelay.milliseconds > 0)
302 {
303 // Sending out the body in a separate async send after delay just for testing purposes
304 SC_ASSERT_RELEASE(content.toSpanConst().sliceStartLength(0, headerBytes, toSend));
305 sendAsync.callback.bind<HttpTestClient, &HttpTestClient::startWaiting>(*this);
306 }
307 else
308 {
309 // Send it all
310 toSend = content.toSpanConst();
311 sendAsync.callback.bind<HttpTestClient, &HttpTestClient::startReceiveResponse>(*this);
312 }
313 auto res = sendAsync.start(*eventLoop, clientSocket, toSend);
314 SC_ASSERT_RELEASE(res);
315}
316
317void SC::HttpTestClient::startSendingHeadersOnExistingConnection()
318{

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected