bind9/lib/isc
Ondřej Surý beecde7120 Rewrite isc_httpd using picohttpparser and isc_url_parse
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.
2022-10-14 11:26:54 +02:00
..
include Rewrite isc_httpd using picohttpparser and isc_url_parse 2022-10-14 11:26:54 +02:00
netmgr Don't set load-balancing socket option on the UDP connect sockets 2022-10-12 15:36:25 +02:00
.gitignore [master] update gitignore files; use rev-parse to get srcid 2014-06-17 13:49:30 -07:00
aes.c Remove EVP_CIPHER_CTX_new() and EVP_CIPHER_CTX_free() shims 2022-03-02 10:48:09 +00:00
ascii.c Consolidate some ASCII tables in isc/ascii and isc/hex 2022-09-12 12:18:57 +01:00
assertions.c Simplify way we tag unreachable code with only ISC_UNREACHABLE() 2022-03-25 08:33:43 +01:00
astack.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
async.c New event loop handling API 2022-08-25 12:24:29 +02:00
backtrace.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
base32.c Remove use of the inline keyword used as suggestion to compiler 2022-03-25 08:33:43 +01:00
base64.c Remove use of the inline keyword used as suggestion to compiler 2022-03-25 08:33:43 +01:00
bind9.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
buffer.c change ISC__BUFFER macros to inline functions 2022-09-26 23:49:27 -07:00
commandline.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
condition.c Enable tracking of pthreads condition variables 2022-07-13 13:19:32 +02:00
counter.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
crc64.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
dir.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
entropy.c Switch the CSPRNG function from RAND_bytes() to uv_random() 2022-09-26 15:13:11 +02:00
errno.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
errno2result.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
errno2result.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
error.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
event.c Simplify the isc_event API 2022-08-25 12:24:25 +02:00
file.c Use the semantic patch to do the unsigned -> unsigned int change 2022-09-19 15:56:02 +02:00
fsaccess.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
fsaccess_common.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
fsaccess_common_p.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
glob.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
hash.c Add a case-insensitive option directly to siphash 2-4 implementation 2022-10-04 10:32:40 +02:00
heap.c Make isc_heap_create() and isc_heap_insert() return void 2022-03-08 11:19:34 +01:00
hex.c Consolidate some ASCII tables in isc/ascii and isc/hex 2022-09-12 12:18:57 +01:00
hmac.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
ht.c Add and use semantic patch to replace isc_mem_get/allocate+memset 2022-10-05 16:44:05 +02:00
httpd.c Rewrite isc_httpd using picohttpparser and isc_url_parse 2022-10-14 11:26:54 +02:00
interfaceiter.c Simplify way we tag unreachable code with only ISC_UNREACHABLE() 2022-03-25 08:33:43 +01:00
iterated_hash.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
jemalloc_shim.h Replace isc_mem_*_aligned(..., alignment) with isc_mem_*x(..., flags) 2022-10-05 16:44:05 +02:00
job.c New event loop handling API 2022-08-25 12:24:29 +02:00
job_p.h New event loop handling API 2022-08-25 12:24:29 +02:00
lex.c Remove use of the inline keyword used as suggestion to compiler 2022-03-25 08:33:43 +01:00
lib.c Use custom isc_mem based allocator for libxml2 2022-09-27 17:10:42 +02:00
log.c Add and use semantic patch to replace isc_mem_get/allocate+memset 2022-10-05 16:44:05 +02:00
loop.c New event loop handling API 2022-08-25 12:24:29 +02:00
loop_p.h Convert isc_ratelimiter API to use on-loop timers 2022-09-21 14:25:33 -07:00
Makefile.am Add picohttpparser.{c.h} from https://github.com/h2o/picohttpparser 2022-10-14 11:26:54 +02:00
managers.c Update netmgr, tasks, and applications to use isc_loopmgr 2022-08-26 09:09:24 +02:00
md.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
mem.c Replace isc_mem_*_aligned(..., alignment) with isc_mem_*x(..., flags) 2022-10-05 16:44:05 +02:00
mem_p.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
meminfo.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
mutex.c Enable tracking of pthreads mutexes 2022-07-13 13:19:32 +02:00
mutex_p.h Use library constructor to create default mutex attr once 2022-07-13 13:19:32 +02:00
mutexblock.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
net.c Remove use of the inline keyword used as suggestion to compiler 2022-03-25 08:33:43 +01:00
netaddr.c Simplify way we tag unreachable code with only ISC_UNREACHABLE() 2022-03-25 08:33:43 +01:00
netscope.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
nonce.c Switch the CSPRNG function from RAND_bytes() to uv_random() 2022-09-26 15:13:11 +02:00
openssl_shim.c Do not provide a shim for SSL_SESSION_is_resumable() 2022-05-23 18:25:18 +03:00
openssl_shim.h Do not provide a shim for SSL_SESSION_is_resumable() 2022-05-23 18:25:18 +03:00
os.c Remove use of the inline keyword used as suggestion to compiler 2022-03-25 08:33:43 +01:00
os_p.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
parseint.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
picohttpparser.c Add picohttpparser.{c.h} from https://github.com/h2o/picohttpparser 2022-10-14 11:26:54 +02:00
picohttpparser.h Add picohttpparser.{c.h} from https://github.com/h2o/picohttpparser 2022-10-14 11:26:54 +02:00
portset.c Use designated initializers instead of memset()/MEM_ZERO for structs 2022-10-05 16:44:05 +02:00
quota.c REQUIRE should not have side effects 2022-07-05 12:22:55 -07:00
radix.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
random.c Switch the CSPRNG function from RAND_bytes() to uv_random() 2022-09-26 15:13:11 +02:00
random_p.h Move random number re-seeding out of the hot path 2022-09-19 16:27:12 +02:00
ratelimiter.c Refactor isc_ratelimiter API 2022-09-30 10:36:30 +02:00
regex.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
region.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
resource.c Avoid dead code warning when using a constant boolean 2022-10-05 15:51:05 +00:00
result.c Add ISC_R_TLSBADPEERCERT error code to the TLS related code 2022-03-28 15:32:30 +03:00
rwlock.c Improve reporting for read-write lock errors 2022-07-13 13:19:32 +02:00
safe.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
serial.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
signal.c New event loop handling API 2022-08-25 12:24:29 +02:00
siphash.c Add a case-insensitive option directly to siphash 2-4 implementation 2022-10-04 10:32:40 +02:00
sockaddr.c Simplify way we tag unreachable code with only ISC_UNREACHABLE() 2022-03-25 08:33:43 +01:00
stats.c Assert if statistics counter underflows in the developer mode 2022-02-10 17:18:09 +01:00
stdio.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
stdtime.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
string.c Use strnstr implementation from FreeBSD if not provided by OS 2022-10-04 14:21:41 +11:00
symtab.c Consolidate some ASCII tables in isc/ascii and isc/hex 2022-09-12 12:18:57 +01:00
syslog.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
task.c Update netmgr, tasks, and applications to use isc_loopmgr 2022-08-26 09:09:24 +02:00
tests Move all the unit tests to /tests/<libname>/ 2022-05-28 14:53:02 -07:00
thread.c Fix error reporting for POSIX Threads functions 2022-09-09 20:25:47 +02:00
tid.c New event loop handling API 2022-08-25 12:24:29 +02:00
time.c Check for working __builtin_mul_overflow() implementation 2022-09-27 17:10:42 +02:00
timer.c Require isc_timer to be manipulated on the timer loop 2022-09-21 14:25:33 -07:00
tls.c Use designated initializers instead of memset()/MEM_ZERO for structs 2022-10-05 16:44:05 +02:00
tm.c Consolidate some ASCII tables in isc/ascii and isc/hex 2022-09-12 12:18:57 +01:00
trampoline.c Move random number re-seeding out of the hot path 2022-09-19 16:27:12 +02:00
trampoline_p.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
url.c Simplify way we tag unreachable code with only ISC_UNREACHABLE() 2022-03-25 08:33:43 +01:00
utf8.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
uv.c Add and use semantic patch to replace isc_mem_get/allocate+memset 2022-10-05 16:44:05 +02:00
work.c New event loop handling API 2022-08-25 12:24:29 +02:00
xml.c Add autoconf option to enable memory leak detection in libraries 2022-09-27 17:53:04 +02:00