[httpd] Main commit that adds multithreading to httpd

Also refactor streaming implementation to make it more like an output and to
let the design support multithreading.
This commit is contained in:
ejurgensen
2023-01-17 17:14:04 +01:00
parent 50a319df2b
commit bd6f38282c
14 changed files with 1300 additions and 1007 deletions

View File

@@ -317,6 +317,11 @@ net_bind(short unsigned *port, int type, const char *log_service_name)
if (fd < 0)
continue;
// Makes us able to attach multiple threads to the same port
ret = setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &yes, sizeof(yes));
if (ret < 0)
continue;
// TODO libevent sets this, we do the same?
ret = setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &yes, sizeof(yes));
if (ret < 0)