| 658 | } |
| 659 | |
| 660 | static int on_header_value(http_parser* p, const char* data, size_t length) |
| 661 | { |
| 662 | StreamingResponseDecoder* decoder = (StreamingResponseDecoder*) p->data; |
| 663 | |
| 664 | // TODO(alexr): We currently do not support trailers, i.e., headers after |
| 665 | // `on_headers_complete` has been called, and instead treat them as errors. |
| 666 | if (decoder->response == nullptr) { |
| 667 | return http_parsing::FAILURE; |
| 668 | } |
| 669 | |
| 670 | decoder->value.append(data, length); |
| 671 | decoder->header = HEADER_VALUE; |
| 672 | return http_parsing::SUCCESS; |
| 673 | } |
| 674 | |
| 675 | static int on_headers_complete(http_parser* p) |
| 676 | { |
nothing calls this directly
no outgoing calls
no test coverage detected