MCPcopy Create free account
hub / github.com/3rdparty/libprocess / on_url

Method on_url

src/decoder.hpp:889–905  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected