85 |
*/ |
*/ |
86 |
int can_http() { |
int can_http() { |
87 |
|
|
88 |
if ( Run.dohttpd && Run.isdaemon ) { |
if(Run.dohttpd && Run.isdaemon) { |
89 |
|
|
90 |
if(! has_hosts_allow() && ! Run.Auth.defined) { |
if(! has_hosts_allow() && ! Run.Auth.defined) { |
91 |
|
|
113 |
|
|
114 |
int status; |
int status; |
115 |
|
|
116 |
switch ( action ) { |
switch(action) { |
117 |
|
|
118 |
case STOP_HTTP: { |
case STOP_HTTP: { |
119 |
|
|
130 |
|
|
131 |
status= pthread_create(&thread, NULL, thread_wrapper, NULL); |
status= pthread_create(&thread, NULL, thread_wrapper, NULL); |
132 |
|
|
133 |
if ( status != 0 ) { |
if(status != 0) { |
134 |
|
|
135 |
log("%s: Failed to create the http server. Thread error -- %s.\n", |
log("%s: Failed to create the http server. Thread error -- %s.\n", |
136 |
prog, strerror(status)); |
prog, strerror(status)); |
149 |
|
|
150 |
pthread_detach(pthread_self()); |
pthread_detach(pthread_self()); |
151 |
|
|
152 |
/* Block the SIGUSR1 signal in this thread */ |
/* Block the SIGUSR1 and SIGHUP signals in this thread */ |
153 |
sigemptyset(&ns); |
sigemptyset(&ns); |
154 |
sigaddset(&ns, SIGUSR1); |
sigaddset(&ns, SIGUSR1); |
155 |
|
sigaddset(&ns, SIGHUP); |
156 |
pthread_sigmask(SIG_BLOCK, &ns, NULL); |
pthread_sigmask(SIG_BLOCK, &ns, NULL); |
157 |
|
|
158 |
start_httpd(Run.httpdport, 10, Run.bind_addr); |
start_httpd(Run.httpdport, 10, Run.bind_addr); |