| 139 | } |
| 140 | |
| 141 | static int on_url(http_parser* p, const char* data, size_t length) |
| 142 | { |
| 143 | DataDecoder* decoder = (DataDecoder*) p->data; |
| 144 | CHECK_NOTNULL(decoder->request); |
| 145 | |
| 146 | // The current http_parser library (version 2.6.2 and below) |
| 147 | // does not support incremental parsing of URLs. To compensate |
| 148 | // we incrementally collect the data and parse it in |
| 149 | // `on_message_complete`. |
| 150 | decoder->url.append(data, length); |
| 151 | |
| 152 | return http_parsing::SUCCESS; |
| 153 | } |
| 154 | |
| 155 | static int on_header_field(http_parser* p, const char* data, size_t length) |
| 156 | { |