mirror of
https://github.com/isc-projects/bind9.git
synced 2026-02-25 10:59:35 -05:00
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. The first two changes makes the code simpler and rely on already existing libraries that we already had (isc_url based on nodejs) or are used elsewhere (picohttpparser). The second two changes remove the artificial "truncation" limit on parsing multiple request. Now only a request that has too many headers (currently 10) or is too big (so, the receive buffer fills up without reaching end of the request) will end the connection. We can be benevolent here with the limites, because the statschannel channel is by definition private and access must be allowed only to administrators of the server. There are no timers, no rate-limiting, no upper limit on the number of requests that can be served, etc. |
||
|---|---|---|
| .. | ||
| bind9 | ||
| dns | ||
| irs | ||
| isc | ||
| isccc | ||
| isccfg | ||
| ns | ||
| .gitignore | ||
| Makefile.am | ||