[svn-commits] rizzo: trunk r44568 - in /trunk/main: http.c manager.c

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


Author: rizzo
Date: Fri Oct  6 10:59:57 2006
New Revision: 44568

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


Modified:
    trunk/main/http.c
    trunk/main/manager.c

Modified: trunk/main/http.c
URL: http://svn.digium.com/view/asterisk/trunk/main/http.c?rev=44568&r1=44567&r2=44568&view=diff
==============================================================================
--- trunk/main/http.c (original)
+++ trunk/main/http.c Fri Oct  6 10:59:57 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: trunk/main/manager.c
URL: http://svn.digium.com/view/asterisk/trunk/main/manager.c?rev=44568&r1=44567&r2=44568&view=diff
==============================================================================
--- trunk/main/manager.c (original)
+++ trunk/main/manager.c Fri Oct  6 10:59:57 2006
@@ -2157,6 +2157,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