| 392 | } |
| 393 | |
| 394 | static int on_header_field(http_parser* p, const char* data, size_t length) |
| 395 | { |
| 396 | ResponseDecoder* decoder = (ResponseDecoder*) p->data; |
| 397 | CHECK_NOTNULL(decoder->response); |
| 398 | |
| 399 | if (decoder->header != HEADER_FIELD) { |
| 400 | decoder->response->headers[decoder->field] = decoder->value; |
| 401 | decoder->field.clear(); |
| 402 | decoder->value.clear(); |
| 403 | } |
| 404 | |
| 405 | decoder->field.append(data, length); |
| 406 | decoder->header = HEADER_FIELD; |
| 407 | |
| 408 | return http_parsing::SUCCESS; |
| 409 | } |
| 410 | |
| 411 | static int on_header_value(http_parser* p, const char* data, size_t length) |
| 412 | { |
nothing calls this directly
no outgoing calls
no test coverage detected