| 179 | } |
| 180 | |
| 181 | static int on_headers_complete(http_parser* p) |
| 182 | { |
| 183 | DataDecoder* decoder = (DataDecoder*) p->data; |
| 184 | |
| 185 | CHECK_NOTNULL(decoder->request); |
| 186 | |
| 187 | // Add final header. |
| 188 | decoder->request->headers[decoder->field] = decoder->value; |
| 189 | decoder->field.clear(); |
| 190 | decoder->value.clear(); |
| 191 | |
| 192 | decoder->request->method = |
| 193 | http_method_str((http_method) decoder->parser.method); |
| 194 | |
| 195 | decoder->request->keepAlive = http_should_keep_alive(&decoder->parser) != 0; |
| 196 | |
| 197 | return http_parsing::SUCCESS; |
| 198 | } |
| 199 | |
| 200 | static int on_body(http_parser* p, const char* data, size_t length) |
| 201 | { |
nothing calls this directly
no outgoing calls
no test coverage detected