"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)
*/
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
* transport API itself).
*/
int received_ack;
-
+#endif
};
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
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;
"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));