mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-25 22:45:05 +00:00
Call xs_socket_accept() from httpd().
This commit is contained in:
parent
cd0413edcb
commit
95d0ce8382
1 changed files with 5 additions and 6 deletions
11
httpd.c
11
httpd.c
|
@ -89,10 +89,9 @@ int server_get_handler(d_char *req, char *q_path,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void httpd_connection(int rs)
|
void httpd_connection(FILE *f)
|
||||||
/* the connection loop */
|
/* the connection processor */
|
||||||
{
|
{
|
||||||
FILE *f;
|
|
||||||
xs *req;
|
xs *req;
|
||||||
char *method;
|
char *method;
|
||||||
int status = 0;
|
int status = 0;
|
||||||
|
@ -105,8 +104,6 @@ void httpd_connection(int rs)
|
||||||
int p_size = 0;
|
int p_size = 0;
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
f = xs_socket_accept(rs);
|
|
||||||
|
|
||||||
req = xs_httpd_request(f, &payload, &p_size);
|
req = xs_httpd_request(f, &payload, &p_size);
|
||||||
|
|
||||||
if (req == NULL) {
|
if (req == NULL) {
|
||||||
|
@ -256,7 +253,9 @@ void httpd(void)
|
||||||
|
|
||||||
if (setjmp(on_break) == 0) {
|
if (setjmp(on_break) == 0) {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
httpd_connection(rs);
|
FILE *f = xs_socket_accept(rs);
|
||||||
|
|
||||||
|
httpd_connection(f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue