aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-10-06 15:59:23 +0000
committerrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-10-06 15:59:23 +0000
commit2a1da1ec5f1693e9dfb228ff9314250ec69f3997 (patch)
tree3f7c8c74230cfe920f0acb49b0b2ebe1136e8019 /main
parent917121a57c8373d8fcf3e18ece18407447f95e4a (diff)
make sure sockets are blocking when they should be blocking.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@44567 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/http.c2
-rw-r--r--main/manager.c3
2 files changed, 5 insertions, 0 deletions
diff --git a/main/http.c b/main/http.c
index e76163105..1b7e08a66 100644
--- a/main/http.c
+++ b/main/http.c
@@ -504,6 +504,8 @@ static void *http_root(void *data)
}
ser = ast_calloc(1, sizeof(*ser));
if (ser) {
+ int flags = fcntl(fd, F_GETFL);
+ fcntl(fd, F_SETFL, flags & ~O_NONBLOCK);
ser->fd = fd;
memcpy(&ser->requestor, &sin, sizeof(ser->requestor));
if ((ser->f = fdopen(ser->fd, "w+"))) {
diff --git a/main/manager.c b/main/manager.c
index ca2bd68fb..12e107ab4 100644
--- a/main/manager.c
+++ b/main/manager.c
@@ -2181,6 +2181,9 @@ static void *accept_thread(void *ignore)
/* For safety, make sure socket is non-blocking */
flags = fcntl(as, F_GETFL);
fcntl(as, F_SETFL, flags | O_NONBLOCK);
+ } else {
+ flags = fcntl(as, F_GETFL);
+ fcntl(as, F_SETFL, flags & ~O_NONBLOCK);
}
ast_mutex_init(&s->__lock);
s->fd = as;