mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
web: fix segmention fault during shutdown of web server (closes #93)
This commit is contained in:
parent
38a63f1f82
commit
59f3e86d21
1 changed files with 6 additions and 5 deletions
11
lib/web.c
11
lib/web.c
|
@ -234,15 +234,16 @@ int web_stop(struct web *w)
|
|||
{
|
||||
info("Stopping Web sub-system");
|
||||
|
||||
if (w->state == STATE_STARTED)
|
||||
if (w->state == STATE_STARTED) {
|
||||
lws_cancel_service(w->context);
|
||||
|
||||
/** @todo Wait for all connections to be closed */
|
||||
/** @todo Wait for all connections to be closed */
|
||||
|
||||
pthread_cancel(w->thread);
|
||||
pthread_join(w->thread, NULL);
|
||||
pthread_cancel(w->thread);
|
||||
pthread_join(w->thread, NULL);
|
||||
|
||||
w->state = STATE_STOPPED;
|
||||
w->state = STATE_STOPPED;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue