gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r6240 - GNUnet/src/transports


From: gnunet
Subject: [GNUnet-SVN] r6240 - GNUnet/src/transports
Date: Sun, 10 Feb 2008 22:02:34 -0700 (MST)

Author: grothoff
Date: 2008-02-10 22:02:34 -0700 (Sun, 10 Feb 2008)
New Revision: 6240

Modified:
   GNUnet/src/transports/tcp.c
Log:
fx

Modified: GNUnet/src/transports/tcp.c
===================================================================
--- GNUnet/src/transports/tcp.c 2008-02-11 04:35:46 UTC (rev 6239)
+++ GNUnet/src/transports/tcp.c 2008-02-11 05:02:34 UTC (rev 6240)
@@ -225,7 +225,7 @@
   GNUNET_GE_ASSERT (coreAPI->ectx, tsession != NULL);
   tcpSession = tsession->internal;
   GNUNET_mutex_lock (lock);
-  if ((tcpSession->users == 0) && (tcpSession->in_select == GNUNET_YES))
+  if (tcpSession->in_select == GNUNET_YES)
     GNUNET_select_change_timeout (selector, tcpSession->sock, TCP_TIMEOUT);
   tcpSession->users++;
   GNUNET_mutex_unlock (lock);
@@ -363,7 +363,7 @@
   GNUNET_mutex_lock (lock);
   tcpSession->in_select = GNUNET_NO;
   if (tcpSession->users == 0)
-      tcp_session_free (tcpSession);
+    tcp_session_free (tcpSession);
   GNUNET_mutex_unlock (lock);
 }
 
@@ -494,8 +494,10 @@
   GNUNET_mutex_lock (lock);
   if (GNUNET_OK ==
       GNUNET_select_connect (selector, tcpSession->sock, tsession))
-    tcpSession->in_select = GNUNET_YES;
-
+    {
+      tcpSession->in_select = GNUNET_YES;
+      GNUNET_select_change_timeout (selector, tcpSession->sock, TCP_TIMEOUT);
+    }
   /* send our node identity to the other side to fully establish the
      connection! */
   welcome.header.size = htons (sizeof (TCPWelcome));





reply via email to

[Prev in Thread] Current Thread [Next in Thread]