received ack removal
authorNathan S. Evans <evans@in.tum.de>
Thu, 4 Feb 2010 11:15:11 +0000 (11:15 +0000)
committerNathan S. Evans <evans@in.tum.de>
Thu, 4 Feb 2010 11:15:11 +0000 (11:15 +0000)
src/transport/gnunet-service-transport.c
src/transport/transport_api.c

index f43094499bdb3bd015d30e7a526f7386de90cdd8..e0802c75855cec31473bbbaa0f6330cc6fe44ea4 100644 (file)
@@ -2186,6 +2186,15 @@ process_hello (struct TransportPlugin *plugin,
               "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)
index 347842e5258892d7f9b800b43c117bcfcd6b4ed4..8b4fe3ffd15fda5b5a364ed6ae300253551de766 100644 (file)
@@ -104,6 +104,7 @@ struct NeighbourList
    */
   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 @@ struct NeighbourList
    * transport API itself).
    */
   int received_ack;
-
+#endif
 };
 
 
@@ -1639,7 +1640,9 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg)
          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 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg)
           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 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg)
                       "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));