diff options
Diffstat (limited to 'httpd.c')
| -rw-r--r-- | httpd.c | 29 |
1 files changed, 15 insertions, 14 deletions
| @@ -183,10 +183,8 @@ void httpd_connection(FILE *f) | |||
| 183 | b_size = strlen(body); | 183 | b_size = strlen(body); |
| 184 | 184 | ||
| 185 | /* if it was a HEAD, no body will be sent */ | 185 | /* if it was a HEAD, no body will be sent */ |
| 186 | if (strcmp(method, "HEAD") == 0) { | 186 | if (strcmp(method, "HEAD") == 0) |
| 187 | free(body); | 187 | body = xs_free(body); |
| 188 | body = NULL; | ||
| 189 | } | ||
| 190 | 188 | ||
| 191 | xs_httpd_response(f, status, headers, body, b_size); | 189 | xs_httpd_response(f, status, headers, body, b_size); |
| 192 | 190 | ||
| @@ -194,7 +192,7 @@ void httpd_connection(FILE *f) | |||
| 194 | 192 | ||
| 195 | srv_archive("RECV", req, payload, p_size, status, headers, body, b_size); | 193 | srv_archive("RECV", req, payload, p_size, status, headers, body, b_size); |
| 196 | 194 | ||
| 197 | free(body); | 195 | xs_free(body); |
| 198 | } | 196 | } |
| 199 | 197 | ||
| 200 | 198 | ||
| @@ -233,18 +231,21 @@ static void *queue_thread(void *arg) | |||
| 233 | srv_log(xs_fmt("queue thread start")); | 231 | srv_log(xs_fmt("queue thread start")); |
| 234 | 232 | ||
| 235 | while (srv_running) { | 233 | while (srv_running) { |
| 236 | xs *list = user_list(); | ||
| 237 | char *p, *uid; | ||
| 238 | time_t t; | 234 | time_t t; |
| 239 | 235 | ||
| 240 | /* process queues for all users */ | 236 | { |
| 241 | p = list; | 237 | xs *list = user_list(); |
| 242 | while (xs_list_iter(&p, &uid)) { | 238 | char *p, *uid; |
| 243 | snac snac; | 239 | |
| 240 | /* process queues for all users */ | ||
| 241 | p = list; | ||
| 242 | while (xs_list_iter(&p, &uid)) { | ||
| 243 | snac snac; | ||
| 244 | 244 | ||
| 245 | if (user_open(&snac, uid)) { | 245 | if (user_open(&snac, uid)) { |
| 246 | process_queue(&snac); | 246 | process_queue(&snac); |
| 247 | user_free(&snac); | 247 | user_free(&snac); |
| 248 | } | ||
| 248 | } | 249 | } |
| 249 | } | 250 | } |
| 250 | 251 | ||