aboutsummaryrefslogtreecommitdiffstats
path: root/http.c
diff options
context:
space:
mode:
Diffstat (limited to 'http.c')
-rw-r--r--http.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/http.c b/http.c
index 2cd168862..c52fb206c 100644
--- a/http.c
+++ b/http.c
@@ -49,7 +49,7 @@
#include "asterisk/config.h"
#define MAX_PREFIX 80
-#define DEFAULT_PREFIX "asterisk"
+#define DEFAULT_PREFIX "/asterisk"
struct ast_http_server_instance {
FILE *f;
@@ -455,6 +455,8 @@ static void *http_root(void *data)
int sinlen;
struct ast_http_server_instance *ser;
pthread_t launched;
+ pthread_attr_t attr;
+
for (;;) {
ast_wait_for_input(httpfd, -1);
sinlen = sizeof(sin);
@@ -469,7 +471,10 @@ static void *http_root(void *data)
ser->fd = fd;
memcpy(&ser->requestor, &sin, sizeof(ser->requestor));
if ((ser->f = fdopen(ser->fd, "w+"))) {
- if (ast_pthread_create(&launched, NULL, ast_httpd_helper_thread, ser)) {
+ pthread_attr_init(&attr);
+ pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+
+ if (ast_pthread_create(&launched, &attr, ast_httpd_helper_thread, ser)) {
ast_log(LOG_WARNING, "Unable to launch helper thread: %s\n", strerror(errno));
fclose(ser->f);
free(ser);