| 887 | } |
| 888 | |
| 889 | static int on_url(http_parser* p, const char* data, size_t length) |
| 890 | { |
| 891 | StreamingRequestDecoder* decoder = (StreamingRequestDecoder*) p->data; |
| 892 | |
| 893 | // URL should not be parsed after `on_headers_complete` has been called. |
| 894 | if (decoder->request == nullptr) { |
| 895 | return http_parsing::FAILURE; |
| 896 | } |
| 897 | |
| 898 | // The current http_parser library (version 2.6.2 and below) |
| 899 | // does not support incremental parsing of URLs. To compensate |
| 900 | // we incrementally collect the data and parse it in |
| 901 | // `on_header_complete`. |
| 902 | decoder->url.append(data, length); |
| 903 | |
| 904 | return http_parsing::SUCCESS; |
| 905 | } |
| 906 | |
| 907 | static int on_header_field(http_parser* p, const char* data, size_t length) |
| 908 | { |
nothing calls this directly
no outgoing calls
no test coverage detected