|
|
@ -494,6 +494,8 @@ static void *http_root(void *data)
|
|
|
|
pthread_attr_t attr;
|
|
|
|
pthread_attr_t attr;
|
|
|
|
|
|
|
|
|
|
|
|
for (;;) {
|
|
|
|
for (;;) {
|
|
|
|
|
|
|
|
int flags;
|
|
|
|
|
|
|
|
|
|
|
|
ast_wait_for_input(httpfd, -1);
|
|
|
|
ast_wait_for_input(httpfd, -1);
|
|
|
|
sinlen = sizeof(sin);
|
|
|
|
sinlen = sizeof(sin);
|
|
|
|
fd = accept(httpfd, (struct sockaddr *)&sin, &sinlen);
|
|
|
|
fd = accept(httpfd, (struct sockaddr *)&sin, &sinlen);
|
|
|
@ -503,8 +505,12 @@ static void *http_root(void *data)
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ser = ast_calloc(1, sizeof(*ser));
|
|
|
|
ser = ast_calloc(1, sizeof(*ser));
|
|
|
|
if (ser) {
|
|
|
|
if (!ser) {
|
|
|
|
int flags = fcntl(fd, F_GETFL);
|
|
|
|
ast_log(LOG_WARNING, "No memory for new session: %s\n", strerror(errno));
|
|
|
|
|
|
|
|
close(fd);
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
flags = fcntl(fd, F_GETFL);
|
|
|
|
fcntl(fd, F_SETFL, flags & ~O_NONBLOCK);
|
|
|
|
fcntl(fd, F_SETFL, flags & ~O_NONBLOCK);
|
|
|
|
ser->fd = fd;
|
|
|
|
ser->fd = fd;
|
|
|
|
memcpy(&ser->requestor, &sin, sizeof(ser->requestor));
|
|
|
|
memcpy(&ser->requestor, &sin, sizeof(ser->requestor));
|
|
|
@ -523,7 +529,6 @@ static void *http_root(void *data)
|
|
|
|
free(ser);
|
|
|
|
free(ser);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|