diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-04-02 23:55:15 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-04-02 23:55:15 +0000 |
commit | f533b7504cb3a60ecd111137223db647b7e170ec (patch) | |
tree | 1210df70261e84f11ad2f8fcaa8e2e83695ff566 /http.c | |
parent | 27e352ac8d12c1d2dbd7bd7351cf8a3e43087ac1 (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.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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); |