netutils/webserver: fix webserver closing bug
authorJunyeon LEE <junyeon2.lee@samsung.com>
Fri, 19 May 2017 16:17:52 +0000 (01:17 +0900)
committerHeesub Shin <heesub.shin@samsung.com>
Tue, 23 May 2017 12:40:02 +0000 (21:40 +0900)
This commit fixes an unresolved webserver issue. When closing webserver,
http_server_stop() repeats pthread_kill() every 100ms regardless of
webserver's thread status. Because this repeatation has possibilities
to make improper thread and webserver status, clean up it.

Change-Id: I84fc088dc3c36f0ae0da5b2fe9443ca5a71c7db1
Signed-off-by: Junyeon LEE <junyeon2.lee@samsung.com>
apps/netutils/webserver/http.c
apps/netutils/webserver/http_server.c

index e58f7c2..7c390a2 100644 (file)
@@ -219,7 +219,6 @@ stop:
 
                for (i = 0; i < HTTP_CONF_MAX_CLIENT_HANDLE;  i++) {
                        pthread_kill(server->c_tid[i], HTTP_CONF_SERVER_SIGWAKEUP);
-                       usleep(10000);
                }
 
                mq_close(msg_q);
index c50956a..3419369 100644 (file)
@@ -87,7 +87,6 @@ int http_server_stop(struct http_server_t *server)
        server->state = HTTP_SERVER_STOP_REQ;
 
        while (server->state != HTTP_SERVER_STOP) {
-               pthread_kill(server->tid, HTTP_CONF_SERVER_SIGWAKEUP);
                usleep(100000);
        }