aboutsummaryrefslogtreecommitdiffstats
path: root/http.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-02 23:55:15 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-02 23:55:15 +0000
commitf533b7504cb3a60ecd111137223db647b7e170ec (patch)
tree1210df70261e84f11ad2f8fcaa8e2e83695ff566 /http.c
parent27e352ac8d12c1d2dbd7bd7351cf8a3e43087ac1 (diff)
Cleanup URI (when none is specified) and make sure threads are stand alone
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@16992 f38db490-d61c-443f-a65b-d21fe96a405b
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);