diff options
| -rw-r--r-- | httpd.c | 11 |
1 files changed, 5 insertions, 6 deletions
| @@ -89,10 +89,9 @@ int server_get_handler(d_char *req, char *q_path, | |||
| 89 | } | 89 | } |
| 90 | 90 | ||
| 91 | 91 | ||
| 92 | void httpd_connection(int rs) | 92 | void httpd_connection(FILE *f) |
| 93 | /* the connection loop */ | 93 | /* the connection processor */ |
| 94 | { | 94 | { |
| 95 | FILE *f; | ||
| 96 | xs *req; | 95 | xs *req; |
| 97 | char *method; | 96 | char *method; |
| 98 | int status = 0; | 97 | int status = 0; |
| @@ -105,8 +104,6 @@ void httpd_connection(int rs) | |||
| 105 | int p_size = 0; | 104 | int p_size = 0; |
| 106 | char *p; | 105 | char *p; |
| 107 | 106 | ||
| 108 | f = xs_socket_accept(rs); | ||
| 109 | |||
| 110 | req = xs_httpd_request(f, &payload, &p_size); | 107 | req = xs_httpd_request(f, &payload, &p_size); |
| 111 | 108 | ||
| 112 | if (req == NULL) { | 109 | if (req == NULL) { |
| @@ -256,7 +253,9 @@ void httpd(void) | |||
| 256 | 253 | ||
| 257 | if (setjmp(on_break) == 0) { | 254 | if (setjmp(on_break) == 0) { |
| 258 | for (;;) { | 255 | for (;;) { |
| 259 | httpd_connection(rs); | 256 | FILE *f = xs_socket_accept(rs); |
| 257 | |||
| 258 | httpd_connection(f); | ||
| 260 | } | 259 | } |
| 261 | } | 260 | } |
| 262 | 261 | ||