[asterisk-commits] mattf: branch mattf/bug13495 r166663 - /team/mattf/bug13495/channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Dec 23 11:55:38 CST 2008


Author: mattf
Date: Tue Dec 23 11:55:37 2008
New Revision: 166663

URL: http://svn.digium.com/view/asterisk?view=rev&rev=166663
Log:
Make sure we enable non block mode for the socket, but only *after* we do the connect

Modified:
    team/mattf/bug13495/channels/chan_dahdi.c

Modified: team/mattf/bug13495/channels/chan_dahdi.c
URL: http://svn.digium.com/view/asterisk/team/mattf/bug13495/channels/chan_dahdi.c?view=diff&rev=166663&r1=166662&r2=166663
==============================================================================
--- team/mattf/bug13495/channels/chan_dahdi.c (original)
+++ team/mattf/bug13495/channels/chan_dahdi.c Tue Dec 23 11:55:37 2008
@@ -14316,6 +14316,15 @@
 				return -1;
 			}
 			
+			memset(&my_addr, 0, sizeof(my_addr));
+			my_addr.sin_family = AF_INET;
+			my_addr.sin_port = htons(SS7_SLAVE_SERVER_PORT);
+			my_addr.sin_addr.s_addr = inet_addr(addr);
+
+			if (connect(link->fds[curfd], &my_addr, sizeof(my_addr)) == -1) {
+				ast_log(LOG_ERROR, "Unable to make initial connection.  Retrying later\n");
+			}
+
 			if ((flags = fcntl(link->fds[curfd], F_GETFL)) < 0) {
 				ast_log(LOG_WARNING,"Fcntl(F_GETFL) failed: %s\n", strerror(errno));
 				close(link->fds[curfd]);
@@ -14326,15 +14335,6 @@
 				close(link->fds[curfd]);
 				return 0;
 			}
-			memset(&my_addr, 0, sizeof(my_addr));
-			my_addr.sin_family = AF_INET;
-			my_addr.sin_port = htons(SS7_SLAVE_SERVER_PORT);
-			my_addr.sin_addr.s_addr = inet_addr(addr);
-
-			if (connect(link->fds[curfd], &my_addr, sizeof(my_addr)) == -1) {
-				ast_log(LOG_ERROR, "Unable to make initial connection.  Retrying later\n");
-			}
-
 			ss7_add_link(link->ss7, SS7_TRANSPORT_TCP, link->fds[curfd], cur_slc, cur_adjpointcode);
 		}
 




More information about the asterisk-commits mailing list