| 355 | |
| 356 | private: |
| 357 | static int on_message_begin(http_parser* p) |
| 358 | { |
| 359 | ResponseDecoder* decoder = (ResponseDecoder*) p->data; |
| 360 | |
| 361 | CHECK(!decoder->failure); |
| 362 | |
| 363 | decoder->header = HEADER_FIELD; |
| 364 | decoder->field.clear(); |
| 365 | decoder->value.clear(); |
| 366 | |
| 367 | CHECK(decoder->response == nullptr); |
| 368 | |
| 369 | decoder->response = new http::Response(); |
| 370 | decoder->response->status.clear(); |
| 371 | decoder->response->headers.clear(); |
| 372 | decoder->response->type = http::Response::BODY; |
| 373 | decoder->response->body.clear(); |
| 374 | decoder->response->path.clear(); |
| 375 | |
| 376 | return http_parsing::SUCCESS; |
| 377 | } |
| 378 | |
| 379 | static int on_chunk_complete(http_parser* p) |
| 380 | { |
nothing calls this directly
no outgoing calls
no test coverage detected