[svn-commits] trunk r16992 - /trunk/http.c
svn-commits at lists.digium.com
svn-commits at lists.digium.com
Sun Apr 2 16:55:16 MST 2006
Author: markster
Date: Sun Apr 2 18:55:15 2006
New Revision: 16992
URL: http://svn.digium.com/view/asterisk?rev=16992&view=rev
Log:
Cleanup URI (when none is specified) and make sure threads are stand alone
Modified:
trunk/http.c
Modified: trunk/http.c
URL: http://svn.digium.com/view/asterisk/trunk/http.c?rev=16992&r1=16991&r2=16992&view=diff
==============================================================================
--- trunk/http.c (original)
+++ trunk/http.c Sun Apr 2 18:55:15 2006
@@ -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 @@
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 @@
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);
More information about the svn-commits
mailing list