aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon/daemon.c')
-rw-r--r--src/daemon/daemon.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c
index 24229793..657afb23 100644
--- a/src/daemon/daemon.c
+++ b/src/daemon/daemon.c
@@ -467,6 +467,7 @@ MHD_start_daemon(unsigned int options,
467 strerror(errno)); 467 strerror(errno));
468 return NULL; 468 return NULL;
469 } 469 }
470 /* FIXME: setsockopt: SO_REUSEADDR? */
470 memset(&servaddr, 471 memset(&servaddr,
471 0, 472 0,
472 sizeof(struct sockaddr_in)); 473 sizeof(struct sockaddr_in));
@@ -541,7 +542,8 @@ MHD_stop_daemon(struct MHD_Daemon * daemon) {
541 close(daemon->connections->socket_fd); 542 close(daemon->connections->socket_fd);
542 daemon->connections->socket_fd = -1; 543 daemon->connections->socket_fd = -1;
543 } 544 }
544 pthread_join(daemon->connections->pid, &unused); 545 if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
546 pthread_join(daemon->connections->pid, &unused);
545 547
546 MHD_cleanup_sessions(daemon); 548 MHD_cleanup_sessions(daemon);
547 } 549 }