| 271 | |
| 272 | void 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 | |
| 295 | void 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); |
nothing calls this directly
no test coverage detected