| 294 | } |
| 295 | |
| 296 | void 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 | |
| 317 | void SC::HttpTestClient::startSendingHeadersOnExistingConnection() |
| 318 | { |