summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordefault <nobody@localhost>2022-10-10 19:33:39 +0200
committerdefault <nobody@localhost>2022-10-10 19:33:39 +0200
commit95d0ce838265d07352aa7d8b3ecd344dae3441e3 (patch)
tree54d94d32e0b07fe10224460f4f185eda85c5f1e5
parentcd0413edcbf59fc49f97ec678f4c29943bd6a6a5 (diff)
Call xs_socket_accept() from httpd().
-rw-r--r--httpd.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/httpd.c b/httpd.c
index f6f9a18..381ab08 100644
--- a/httpd.c
+++ b/httpd.c
@@ -89,10 +89,9 @@ int server_get_handler(d_char *req, char *q_path,
}
-void httpd_connection(int rs)
-/* the connection loop */
+void httpd_connection(FILE *f)
+/* the connection processor */
{
- FILE *f;
xs *req;
char *method;
int status = 0;
@@ -105,8 +104,6 @@ void httpd_connection(int rs)
int p_size = 0;
char *p;
- f = xs_socket_accept(rs);
-
req = xs_httpd_request(f, &payload, &p_size);
if (req == NULL) {
@@ -256,7 +253,9 @@ void httpd(void)
if (setjmp(on_break) == 0) {
for (;;) {
- httpd_connection(rs);
+ FILE *f = xs_socket_accept(rs);
+
+ httpd_connection(f);
}
}