Skip to content

Rewrite isc_httpd using picohttpparser and isc_url_parse [v9.18]

Ondřej Surý requested to merge ondrej-refactor-isc_httpd-v9_18 into v9_18

Rewrite the isc_httpd to be more robust.

  1. Replace the hand-crafted HTTP request parser with picohttpparser for parsing the whole HTTP/1.0 and HTTP/1.1 requests. Limit the number of allowed headers to 10 (arbitrary number).
  2. Replace the hand-crafted URL parser with isc_url_parse for parsing the URL from the HTTP request.
  3. Increase the receive buffer to match the isc_netmgr buffers, so we can at least receive two full isc_nm_read()s. This makes the truncation processing much simpler.
  4. Process the received buffer from single isc_nm_read() in a single loop and schedule the sends to be independent of each other.
  5. Replace the truncated test with two new tests: a) test that sending more than 10 headers makes the connection to closed; b) test that sending huge HTTP request makes the connection to be closed.

Backport of !6879 (merged)

Edited by Michał Kępień

Merge request reports