[svn-commits] rizzo: branch 1.4 r44567 - in /branches/1.4/main: http.c manager.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Fri Oct 6 08:59:26 MST 2006


Author: rizzo
Date: Fri Oct  6 10:59:23 2006
New Revision: 44567

URL: http://svn.digium.com/view/asterisk?rev=44567&view=rev
Log:
make sure sockets are blocking when they should be blocking.


Modified:
    branches/1.4/main/http.c
    branches/1.4/main/manager.c

Modified: branches/1.4/main/http.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/http.c?rev=44567&r1=44566&r2=44567&view=diff
==============================================================================
--- branches/1.4/main/http.c (original)
+++ branches/1.4/main/http.c Fri Oct  6 10:59:23 2006
@@ -504,6 +504,8 @@
 		}
 		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+"))) {

Modified: branches/1.4/main/manager.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/manager.c?rev=44567&r1=44566&r2=44567&view=diff
==============================================================================
--- branches/1.4/main/manager.c (original)
+++ branches/1.4/main/manager.c Fri Oct  6 10:59:23 2006
@@ -2181,6 +2181,9 @@
 			/* 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;



More information about the svn-commits mailing list