gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r10209 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r10209 - gnunet/src/transport
Date: Thu, 4 Feb 2010 12:15:11 +0100

Author: nevans
Date: 2010-02-04 12:15:11 +0100 (Thu, 04 Feb 2010)
New Revision: 10209

Modified:
   gnunet/src/transport/gnunet-service-transport.c
   gnunet/src/transport/transport_api.c
Log:
received ack removal

Modified: gnunet/src/transport/gnunet-service-transport.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport.c     2010-02-04 11:03:27 UTC 
(rev 10208)
+++ gnunet/src/transport/gnunet-service-transport.c     2010-02-04 11:15:11 UTC 
(rev 10209)
@@ -2186,6 +2186,15 @@
               "Processing `%s' message for `%4s' of size %d (hsize is %d)\n",
               "HELLO", GNUNET_i2s (&target), GNUNET_HELLO_size(hello), hsize);
 #endif
+
+#if DEBUG_TRANSPORT
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "Notifying peerinfo about peer %s\n",
+              GNUNET_i2s (&target));
+#endif
+  /* For some reason the line below causes something to hang up... maybe 
peerinfo isn't ready yet? */
+  /*GNUNET_PEERINFO_add_peer (cfg, sched, &target, hello); */
+
   /* check if a HELLO for this peer is already on the validation list */
   e = pending_validations;
   while (e != NULL)

Modified: gnunet/src/transport/transport_api.c
===================================================================
--- gnunet/src/transport/transport_api.c        2010-02-04 11:03:27 UTC (rev 
10208)
+++ gnunet/src/transport/transport_api.c        2010-02-04 11:15:11 UTC (rev 
10209)
@@ -104,6 +104,7 @@
    */
   int transmit_ok;
 
+#if ACK
   /**
    * Set to GNUNET_YES if we have received an ACK for the
    * given peer.  Peers that receive our HELLO always respond
@@ -114,7 +115,7 @@
    * transport API itself).
    */
   int received_ack;
-
+#endif
 };
 
 
@@ -1639,7 +1640,9 @@
          GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                      "Do know neighbor, scheduling transmission!\n");
 #endif
+#if ACK
          n->received_ack = GNUNET_YES;
+#endif
           if (NULL != n->transmit_handle)
             {
 #if DEBUG_TRANSPORT
@@ -1736,7 +1739,6 @@
           GNUNET_SCHEDULER_cancel (h->sched,
                                    n->transmit_handle->notify_delay_task);
           n->transmit_handle->notify_delay_task = GNUNET_SCHEDULER_NO_TASK;
-          GNUNET_assert (GNUNET_YES == n->received_ack);
           schedule_request (n->transmit_handle);
         }
       break;
@@ -1767,31 +1769,29 @@
                       "Receiving `%s' message from `%4s'.\n",
                       "ACK", GNUNET_i2s (&im->peer));
 #endif
+          break;
+        default:
+#if DEBUG_TRANSPORT
+          GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                      "Received message of type %u from `%4s'.\n",
+                      ntohs (imm->type), GNUNET_i2s (&im->peer));
+#endif
+
           n = find_neighbour (h, &im->peer);
           if (n == NULL)
             {
               GNUNET_break (0);
               break;
             }
-          if (n->received_ack == GNUNET_NO)
+
+          if (NULL != n->transmit_handle)
             {
-              n->received_ack = GNUNET_YES;
-              if (NULL != n->transmit_handle)
-                {
 #if DEBUG_TRANSPORT
-                  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                              "Peer connected, scheduling delayed message for 
delivery now.\n");
+              GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                          "Peer connected, scheduling delayed message for 
delivery now.\n");
 #endif
-                  schedule_request (n->transmit_handle);
-                }
+              schedule_request (n->transmit_handle);
             }
-          break;
-        default:
-#if DEBUG_TRANSPORT
-          GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                      "Received message of type %u from `%4s'.\n",
-                      ntohs (imm->type), GNUNET_i2s (&im->peer));
-#endif
           if (h->rec != NULL)
             h->rec (h->cls, &im->peer, imm,
                     GNUNET_TIME_relative_ntoh (im->latency), 
ntohs(im->distance));





reply via email to

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