summaryrefslogtreecommitdiff
path: root/thread_http.c
diff options
context:
space:
mode:
Diffstat (limited to 'thread_http.c')
-rw-r--r--thread_http.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/thread_http.c b/thread_http.c
index e410239..b257131 100644
--- a/thread_http.c
+++ b/thread_http.c
@@ -100,6 +100,8 @@ void *start_http_connection_inner(void *arg_anon) {
return NULL;
}
+int httpsock = 0;
+
static
void start_http_connection(int fd) {
wg_add(wg, 1);
@@ -113,12 +115,14 @@ void thread_http_listener(struct wg *awg,
wg = awg;
video = avideo;
depth = adepth;
- int sock = tcp4_parse_listen("8090");
+ httpsock = tcp4_parse_listen("8090");
while (running) {
- int conn = accept(sock, NULL, NULL);
+ int conn = accept(httpsock, NULL, NULL);
if (conn < 0)
continue;
start_http_connection(conn);
}
+ running = 0;
+ close(httpsock);
}