aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-tng.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-05-11 15:11:52 +0200
committerChristian Grothoff <christian@grothoff.org>2019-05-11 15:11:52 +0200
commitda604c171418b64fcd37a46c4526ba97b6ee47dc (patch)
tree875241f63d7971ee9334886ed64c299c875890ac /src/transport/gnunet-service-tng.c
parentf390dabd6cf746840484d4f19846a083b49d23da (diff)
downloadgnunet-da604c171418b64fcd37a46c4526ba97b6ee47dc.tar.gz
gnunet-da604c171418b64fcd37a46c4526ba97b6ee47dc.zip
complete TNG logging
Diffstat (limited to 'src/transport/gnunet-service-tng.c')
-rw-r--r--src/transport/gnunet-service-tng.c155
1 files changed, 133 insertions, 22 deletions
diff --git a/src/transport/gnunet-service-tng.c b/src/transport/gnunet-service-tng.c
index 2141bc8e1..08a8ec893 100644
--- a/src/transport/gnunet-service-tng.c
+++ b/src/transport/gnunet-service-tng.c
@@ -24,7 +24,6 @@
24 * 24 *
25 * TODO: 25 * TODO:
26 * Implement next: 26 * Implement next:
27 * - add (more) logging (beyond line ~7500)
28 * - properly encrypt *all* DV traffic, not only backchannel; 27 * - properly encrypt *all* DV traffic, not only backchannel;
29 * rename BackchannelEncapsulation logic to DVEncapsulation! 28 * rename BackchannelEncapsulation logic to DVEncapsulation!
30 * - realize transport-to-transport flow control (needed in case 29 * - realize transport-to-transport flow control (needed in case
@@ -1959,6 +1958,12 @@ struct PendingMessage
1959 struct MessageUUIDP msg_uuid; 1958 struct MessageUUIDP msg_uuid;
1960 1959
1961 /** 1960 /**
1961 * UUID we use to identify this message in our logs.
1962 * Generated by incrementing the "logging_uuid_gen".
1963 */
1964 unsigned long long logging_uuid;
1965
1966 /**
1962 * Type of the pending message. 1967 * Type of the pending message.
1963 */ 1968 */
1964 enum PendingMessageType pmt; 1969 enum PendingMessageType pmt;
@@ -2545,6 +2550,11 @@ static struct PendingAcknowledgement *pa_head;
2545static struct PendingAcknowledgement *pa_tail; 2550static struct PendingAcknowledgement *pa_tail;
2546 2551
2547/** 2552/**
2553 * Generator of `logging_uuid` in `struct PendingMessage`.
2554 */
2555static unsigned long long logging_uuid_gen;
2556
2557/**
2548 * Number of entries in the #pa_head/#pa_tail DLL. Used to 2558 * Number of entries in the #pa_head/#pa_tail DLL. Used to
2549 * limit the size of the data structure. 2559 * limit the size of the data structure.
2550 */ 2560 */
@@ -3117,7 +3127,8 @@ schedule_transmit_on_queue (struct Queue *queue, int inside_job)
3117 { 3127 {
3118 GNUNET_log ( 3128 GNUNET_log (
3119 GNUNET_ERROR_TYPE_DEBUG, 3129 GNUNET_ERROR_TYPE_DEBUG,
3120 "Schedule transmission on queue %llu of %s decides to run immediately\n", 3130 "Schedule transmission <%llu> on queue %llu of %s decides to run immediately\n",
3131 pm->logging_uuid,
3121 (unsigned long long) queue->qid, 3132 (unsigned long long) queue->qid,
3122 GNUNET_i2s (&n->pid)); 3133 GNUNET_i2s (&n->pid));
3123 return; /* we should run immediately! */ 3134 return; /* we should run immediately! */
@@ -3127,12 +3138,14 @@ schedule_transmit_on_queue (struct Queue *queue, int inside_job)
3127 GNUNET_SCHEDULER_add_delayed (out_delay, &transmit_on_queue, queue); 3138 GNUNET_SCHEDULER_add_delayed (out_delay, &transmit_on_queue, queue);
3128 if (out_delay.rel_value_us > DELAY_WARN_THRESHOLD.rel_value_us) 3139 if (out_delay.rel_value_us > DELAY_WARN_THRESHOLD.rel_value_us)
3129 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 3140 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
3130 "Next transmission on queue `%s' in %s (high delay)\n", 3141 "Next transmission <%llu> on queue `%s' in %s (high delay)\n",
3142 pm->logging_uuid,
3131 queue->address, 3143 queue->address,
3132 GNUNET_STRINGS_relative_time_to_string (out_delay, GNUNET_YES)); 3144 GNUNET_STRINGS_relative_time_to_string (out_delay, GNUNET_YES));
3133 else 3145 else
3134 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 3146 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
3135 "Next transmission on queue `%s' in %s\n", 3147 "Next transmission <%llu> on queue `%s' in %s\n",
3148 pm->logging_uuid,
3136 queue->address, 3149 queue->address,
3137 GNUNET_STRINGS_relative_time_to_string (out_delay, GNUNET_YES)); 3150 GNUNET_STRINGS_relative_time_to_string (out_delay, GNUNET_YES));
3138} 3151}
@@ -3573,7 +3586,8 @@ client_send_response (struct PendingMessage *pm)
3573 env = GNUNET_MQ_msg (som, GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_OK); 3586 env = GNUNET_MQ_msg (som, GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_OK);
3574 som->peer = target->pid; 3587 som->peer = target->pid;
3575 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 3588 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
3576 "Confirming transmission to %s\n", 3589 "Confirming transmission of <%llu> to %s\n",
3590 pm->logging_uuid,
3577 GNUNET_i2s (&pm->target->pid)); 3591 GNUNET_i2s (&pm->target->pid));
3578 GNUNET_MQ_send (tc->mq, env); 3592 GNUNET_MQ_send (tc->mq, env);
3579 } 3593 }
@@ -3773,11 +3787,6 @@ handle_client_send (void *cls, const struct OutboundMessage *obm)
3773 else 3787 else
3774 dv = NULL; 3788 dv = NULL;
3775 GNUNET_assert ((NULL != target) || (NULL != dv)); 3789 GNUNET_assert ((NULL != target) || (NULL != dv));
3776 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
3777 "Sending %u bytes to %s using %s\n",
3778 bytes_msg,
3779 GNUNET_i2s (&obm->peer),
3780 (NULL == target) ? "distance vector path" : "direct queue");
3781 if (NULL == target) 3790 if (NULL == target)
3782 { 3791 {
3783 unsigned int res; 3792 unsigned int res;
@@ -3807,6 +3816,7 @@ handle_client_send (void *cls, const struct OutboundMessage *obm)
3807 3816
3808 was_empty = (NULL == target->pending_msg_head); 3817 was_empty = (NULL == target->pending_msg_head);
3809 pm = GNUNET_malloc (sizeof (struct PendingMessage) + payload_size); 3818 pm = GNUNET_malloc (sizeof (struct PendingMessage) + payload_size);
3819 pm->logging_uuid = logging_uuid_gen++;
3810 pm->prefs = pp; 3820 pm->prefs = pp;
3811 pm->client = tc; 3821 pm->client = tc;
3812 pm->target = target; 3822 pm->target = target;
@@ -3815,6 +3825,12 @@ handle_client_send (void *cls, const struct OutboundMessage *obm)
3815 GNUNET_free_non_null (dvb); 3825 GNUNET_free_non_null (dvb);
3816 dvb = NULL; 3826 dvb = NULL;
3817 pm->dvh = dvh; 3827 pm->dvh = dvh;
3828 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
3829 "Sending %u bytes as <%llu> to %s using %s\n",
3830 bytes_msg,
3831 pm->logging_uuid,
3832 GNUNET_i2s (&obm->peer),
3833 (NULL == target) ? "distance vector path" : "direct queue");
3818 if (NULL != dvh) 3834 if (NULL != dvh)
3819 { 3835 {
3820 GNUNET_CONTAINER_MDLL_insert (dvh, 3836 GNUNET_CONTAINER_MDLL_insert (dvh,
@@ -4140,11 +4156,13 @@ queue_send_msg (struct Queue *queue,
4140 struct GNUNET_TRANSPORT_SendMessageTo *smt; 4156 struct GNUNET_TRANSPORT_SendMessageTo *smt;
4141 struct GNUNET_MQ_Envelope *env; 4157 struct GNUNET_MQ_Envelope *env;
4142 4158
4143 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 4159 GNUNET_log (
4144 "Queueing %u bytes of payload for transmission on queue %llu to %s\n", 4160 GNUNET_ERROR_TYPE_DEBUG,
4145 (unsigned int) payload_size, 4161 "Queueing %u bytes of payload for transmission <%llu> on queue %llu to %s\n",
4146 (unsigned long long) queue->qid, 4162 (unsigned int) payload_size,
4147 GNUNET_i2s (&queue->neighbour->pid)); 4163 pm->logging_uuid,
4164 (unsigned long long) queue->qid,
4165 GNUNET_i2s (&queue->neighbour->pid));
4148 env = GNUNET_MQ_msg_extra (smt, 4166 env = GNUNET_MQ_msg_extra (smt,
4149 payload_size, 4167 payload_size,
4150 GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_MSG); 4168 GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_MSG);
@@ -7566,9 +7584,6 @@ set_pending_message_uuid (struct PendingMessage *pm)
7566} 7584}
7567 7585
7568 7586
7569// FIXME: add logging logic from here!
7570
7571
7572/** 7587/**
7573 * Setup data structure waiting for acknowledgements. 7588 * Setup data structure waiting for acknowledgements.
7574 * 7589 *
@@ -7604,6 +7619,10 @@ prepare_pending_acknowledgement (struct Queue *queue,
7604 GNUNET_CONTAINER_MDLL_insert (dvh, dvh->pa_head, dvh->pa_tail, pa); 7619 GNUNET_CONTAINER_MDLL_insert (dvh, dvh->pa_head, dvh->pa_tail, pa);
7605 pa->transmission_time = GNUNET_TIME_absolute_get (); 7620 pa->transmission_time = GNUNET_TIME_absolute_get ();
7606 pa->message_size = pm->bytes_msg; 7621 pa->message_size = pm->bytes_msg;
7622 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
7623 "Waiting for ACKnowledgment `%s' for <%llu>\n",
7624 GNUNET_sh2s (&pa->ack_uuid.value),
7625 pm->logging_uuid);
7607 return pa; 7626 return pa;
7608} 7627}
7609 7628
@@ -7628,11 +7647,17 @@ fragment_message (struct Queue *queue,
7628 struct PendingMessage *ff; 7647 struct PendingMessage *ff;
7629 uint16_t mtu; 7648 uint16_t mtu;
7630 7649
7631 pa = prepare_pending_acknowledgement (queue, dvh, pm);
7632 mtu = (0 == queue->mtu) 7650 mtu = (0 == queue->mtu)
7633 ? UINT16_MAX - sizeof (struct GNUNET_TRANSPORT_SendMessageTo) 7651 ? UINT16_MAX - sizeof (struct GNUNET_TRANSPORT_SendMessageTo)
7634 : queue->mtu; 7652 : queue->mtu;
7635 set_pending_message_uuid (pm); 7653 set_pending_message_uuid (pm);
7654 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
7655 "Fragmenting message %llu <%llu> to %s for MTU %u\n",
7656 (unsigned long long) pm->msg_uuid.uuid,
7657 pm->logging_uuid,
7658 GNUNET_i2s (&pm->target->pid),
7659 (unsigned int) mtu);
7660 pa = prepare_pending_acknowledgement (queue, dvh, pm);
7636 7661
7637 /* This invariant is established in #handle_add_queue_message() */ 7662 /* This invariant is established in #handle_add_queue_message() */
7638 GNUNET_assert (mtu > sizeof (struct TransportFragmentBoxMessage)); 7663 GNUNET_assert (mtu > sizeof (struct TransportFragmentBoxMessage));
@@ -7676,6 +7701,7 @@ fragment_message (struct Queue *queue,
7676 frag = 7701 frag =
7677 GNUNET_malloc (sizeof (struct PendingMessage) + 7702 GNUNET_malloc (sizeof (struct PendingMessage) +
7678 sizeof (struct TransportFragmentBoxMessage) + fragsize); 7703 sizeof (struct TransportFragmentBoxMessage) + fragsize);
7704 frag->logging_uuid = logging_uuid_gen++;
7679 frag->target = pm->target; 7705 frag->target = pm->target;
7680 frag->frag_parent = ff; 7706 frag->frag_parent = ff;
7681 frag->timeout = pm->timeout; 7707 frag->timeout = pm->timeout;
@@ -7744,10 +7770,16 @@ reliability_box_message (struct Queue *queue,
7744 client_send_response (pm); 7770 client_send_response (pm);
7745 return NULL; 7771 return NULL;
7746 } 7772 }
7773 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
7774 "Preparing reliability box for message <%llu> to %s on queue %s\n",
7775 pm->logging_uuid,
7776 GNUNET_i2s (&pm->target->pid),
7777 queue->address);
7747 pa = prepare_pending_acknowledgement (queue, dvh, pm); 7778 pa = prepare_pending_acknowledgement (queue, dvh, pm);
7748 7779
7749 bpm = GNUNET_malloc (sizeof (struct PendingMessage) + sizeof (rbox) + 7780 bpm = GNUNET_malloc (sizeof (struct PendingMessage) + sizeof (rbox) +
7750 pm->bytes_msg); 7781 pm->bytes_msg);
7782 bpm->logging_uuid = logging_uuid_gen++;
7751 bpm->target = pm->target; 7783 bpm->target = pm->target;
7752 bpm->frag_parent = pm; 7784 bpm->frag_parent = pm;
7753 GNUNET_CONTAINER_MDLL_insert (frag, pm->head_frag, pm->tail_frag, bpm); 7785 GNUNET_CONTAINER_MDLL_insert (frag, pm->head_frag, pm->tail_frag, bpm);
@@ -7783,6 +7815,11 @@ update_pm_next_attempt (struct PendingMessage *pm,
7783 struct Neighbour *neighbour = pm->target; 7815 struct Neighbour *neighbour = pm->target;
7784 7816
7785 pm->next_attempt = next_attempt; 7817 pm->next_attempt = next_attempt;
7818 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
7819 "Next attempt for message <%llu> set to %s\n",
7820 pm->logging_uuid,
7821 GNUNET_STRINGS_absolute_time_to_string (next_attempt));
7822
7786 if (NULL == pm->frag_parent) 7823 if (NULL == pm->frag_parent)
7787 { 7824 {
7788 struct PendingMessage *pos; 7825 struct PendingMessage *pos;
@@ -7843,17 +7880,32 @@ transmit_on_queue (void *cls)
7843 if (NULL == (pm = n->pending_msg_head)) 7880 if (NULL == (pm = n->pending_msg_head))
7844 { 7881 {
7845 /* no message pending, nothing to do here! */ 7882 /* no message pending, nothing to do here! */
7883 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
7884 "No messages waiting on queue %s to %s, going to sleep\n",
7885 queue->address,
7886 GNUNET_i2s (&n->pid));
7846 return; 7887 return;
7847 } 7888 }
7848 if (NULL != pm->qe) 7889 if (NULL != pm->qe)
7849 { 7890 {
7850 /* message still pending with communciator! 7891 /* message still pending with communciator!
7851 LOGGING-FIXME: Use stats? logging? Should this not be rare? */ 7892 LOGGING-FIXME: Use stats? Should this not be rare? */
7893 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
7894 "Waiting on communicator for queue %s to %s, going to sleep\n",
7895 queue->address,
7896 GNUNET_i2s (&n->pid));
7852 return; 7897 return;
7853 } 7898 }
7854 schedule_transmit_on_queue (queue, GNUNET_YES); 7899 schedule_transmit_on_queue (queue, GNUNET_YES);
7855 if (NULL != queue->transmit_task) 7900 if (NULL != queue->transmit_task)
7901 {
7902 GNUNET_log (
7903 GNUNET_ERROR_TYPE_DEBUG,
7904 "Scheduled transmission on queue %s to %s for later, going to sleep\n",
7905 queue->address,
7906 GNUNET_i2s (&n->pid));
7856 return; /* do it later */ 7907 return; /* do it later */
7908 }
7857 overhead = 0; 7909 overhead = 0;
7858 if (GNUNET_TRANSPORT_CC_RELIABLE != queue->tc->details.communicator.cc) 7910 if (GNUNET_TRANSPORT_CC_RELIABLE != queue->tc->details.communicator.cc)
7859 overhead += sizeof (struct TransportReliabilityBoxMessage); 7911 overhead += sizeof (struct TransportReliabilityBoxMessage);
@@ -7868,6 +7920,11 @@ transmit_on_queue (void *cls)
7868 if (NULL == s) 7920 if (NULL == s)
7869 { 7921 {
7870 /* Fragmentation failed, try next message... */ 7922 /* Fragmentation failed, try next message... */
7923 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
7924 "Fragmentation failed queue %s to %s for <%llu>, trying again\n",
7925 queue->address,
7926 GNUNET_i2s (&n->pid),
7927 pm->logging_uuid);
7871 schedule_transmit_on_queue (queue, GNUNET_NO); 7928 schedule_transmit_on_queue (queue, GNUNET_NO);
7872 return; 7929 return;
7873 } 7930 }
@@ -7877,11 +7934,22 @@ transmit_on_queue (void *cls)
7877 if (NULL == s) 7934 if (NULL == s)
7878 { 7935 {
7879 /* Reliability boxing failed, try next message... */ 7936 /* Reliability boxing failed, try next message... */
7937 GNUNET_log (
7938 GNUNET_ERROR_TYPE_DEBUG,
7939 "Reliability boxing failed queue %s to %s for <%llu>, trying again\n",
7940 queue->address,
7941 GNUNET_i2s (&n->pid),
7942 pm->logging_uuid);
7880 schedule_transmit_on_queue (queue, GNUNET_NO); 7943 schedule_transmit_on_queue (queue, GNUNET_NO);
7881 return; 7944 return;
7882 } 7945 }
7883 7946
7884 /* Pass 's' for transission to the communicator */ 7947 /* Pass 's' for transission to the communicator */
7948 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
7949 "Passing message <%llu> to queue %s for peer %s\n",
7950 s->logging_uuid,
7951 queue->address,
7952 GNUNET_i2s (&n->pid));
7885 queue_send_msg (queue, s, &s[1], s->bytes_msg); 7953 queue_send_msg (queue, s, &s[1], s->bytes_msg);
7886 // FIXME: do something similar to the logic below 7954 // FIXME: do something similar to the logic below
7887 // in defragmentation / reliability ACK handling! 7955 // in defragmentation / reliability ACK handling!
@@ -7971,6 +8039,10 @@ handle_del_queue_message (void *cls,
7971 if ((dqm->qid != queue->qid) || 8039 if ((dqm->qid != queue->qid) ||
7972 (0 != GNUNET_memcmp (&dqm->receiver, &neighbour->pid))) 8040 (0 != GNUNET_memcmp (&dqm->receiver, &neighbour->pid)))
7973 continue; 8041 continue;
8042 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
8043 "Dropped queue %s to peer %s\n",
8044 queue->address,
8045 GNUNET_i2s (&neighbour->pid));
7974 free_queue (queue); 8046 free_queue (queue);
7975 GNUNET_SERVICE_client_continue (tc->client); 8047 GNUNET_SERVICE_client_continue (tc->client);
7976 return; 8048 return;
@@ -8030,6 +8102,12 @@ handle_send_message_ack (void *cls,
8030 qe); 8102 qe);
8031 qe->queue->queue_length--; 8103 qe->queue->queue_length--;
8032 tc->details.communicator.total_queue_length--; 8104 tc->details.communicator.total_queue_length--;
8105 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
8106 "Received ACK on queue %s to peer %s (new length: %u/%u)\n",
8107 qe->queue->address,
8108 GNUNET_i2s (&qe->queue->neighbour->pid),
8109 qe->queue->queue_length,
8110 tc->details.communicator.total_queue_length);
8033 GNUNET_SERVICE_client_continue (tc->client); 8111 GNUNET_SERVICE_client_continue (tc->client);
8034 8112
8035 /* if applicable, resume transmissions that waited on ACK */ 8113 /* if applicable, resume transmissions that waited on ACK */
@@ -8078,7 +8156,8 @@ handle_send_message_ack (void *cls,
8078 { 8156 {
8079 GNUNET_log ( 8157 GNUNET_log (
8080 GNUNET_ERROR_TYPE_INFO, 8158 GNUNET_ERROR_TYPE_INFO,
8081 "Queue failed in transmission, will try retransmission immediately\n"); 8159 "Queue failed in transmission <%llu>, will try retransmission immediately\n",
8160 pm->logging_uuid);
8082 update_pm_next_attempt (pm, GNUNET_TIME_UNIT_ZERO_ABS); 8161 update_pm_next_attempt (pm, GNUNET_TIME_UNIT_ZERO_ABS);
8083 } 8162 }
8084 } 8163 }
@@ -8200,6 +8279,10 @@ suggest_to_connect (const struct GNUNET_PeerIdentity *pid, const char *address)
8200 "# Suggestions ignored due to missing communicator", 8279 "# Suggestions ignored due to missing communicator",
8201 1, 8280 1,
8202 GNUNET_NO); 8281 GNUNET_NO);
8282 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
8283 "Cannot connect to %s at `%s', no matching communicator present\n",
8284 GNUNET_i2s (pid),
8285 address);
8203 return; 8286 return;
8204 } 8287 }
8205 /* forward suggestion for queue creation to communicator */ 8288 /* forward suggestion for queue creation to communicator */
@@ -8237,6 +8320,10 @@ validation_transmit_on_queue (struct Queue *q, struct ValidationState *vs)
8237 tvc.reserved = htonl (0); 8320 tvc.reserved = htonl (0);
8238 tvc.challenge = vs->challenge; 8321 tvc.challenge = vs->challenge;
8239 tvc.sender_time = GNUNET_TIME_absolute_hton (vs->last_challenge_use); 8322 tvc.sender_time = GNUNET_TIME_absolute_hton (vs->last_challenge_use);
8323 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
8324 "Sending address validation challenge %s to %s\n",
8325 GNUNET_sh2s (&tvc.challenge.value),
8326 GNUNET_i2s (&q->neighbour->pid));
8240 queue_send_msg (q, NULL, &tvc, sizeof (tvc)); 8327 queue_send_msg (q, NULL, &tvc, sizeof (tvc));
8241} 8328}
8242 8329
@@ -8264,8 +8351,12 @@ validation_start_cb (void *cls)
8264 vs = GNUNET_CONTAINER_heap_peek (validation_heap); 8351 vs = GNUNET_CONTAINER_heap_peek (validation_heap);
8265 } 8352 }
8266 if (NULL == vs) 8353 if (NULL == vs)
8354 {
8355 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
8356 "Address validation task not scheduled anymore, nothing to do\n");
8267 return; /* woopsie, no more addresses known, should only 8357 return; /* woopsie, no more addresses known, should only
8268 happen if we're really a lonely peer */ 8358 happen if we're really a lonely peer */
8359 }
8269 q = find_queue (&vs->pid, vs->address); 8360 q = find_queue (&vs->pid, vs->address);
8270 if (NULL == q) 8361 if (NULL == q)
8271 { 8362 {
@@ -8278,6 +8369,10 @@ validation_start_cb (void *cls)
8278 vs->challenge_backoff = 8369 vs->challenge_backoff =
8279 GNUNET_TIME_randomized_backoff (vs->challenge_backoff, 8370 GNUNET_TIME_randomized_backoff (vs->challenge_backoff,
8280 MAX_VALIDATION_CHALLENGE_FREQ); 8371 MAX_VALIDATION_CHALLENGE_FREQ);
8372 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
8373 "Address validation task will run again in %s\n",
8374 GNUNET_STRINGS_relative_time_to_string (vs->challenge_backoff,
8375 GNUNET_YES));
8281 update_next_challenge_time (vs, 8376 update_next_challenge_time (vs,
8282 GNUNET_TIME_relative_to_absolute ( 8377 GNUNET_TIME_relative_to_absolute (
8283 vs->challenge_backoff)); 8378 vs->challenge_backoff));
@@ -8385,6 +8480,10 @@ start_dv_learn (void *cls)
8385 /* scale our retries by how far we are above the threshold */ 8480 /* scale our retries by how far we are above the threshold */
8386 factor = qqc.quality_count / DV_LEARN_QUALITY_THRESHOLD; 8481 factor = qqc.quality_count / DV_LEARN_QUALITY_THRESHOLD;
8387 delay = GNUNET_TIME_relative_multiply (DV_LEARN_BASE_FREQUENCY, factor); 8482 delay = GNUNET_TIME_relative_multiply (DV_LEARN_BASE_FREQUENCY, factor);
8483 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
8484 "At connection quality %u, will launch DV learn in %s\n",
8485 qqc.quality_count,
8486 GNUNET_STRINGS_relative_time_to_string (delay, GNUNET_YES));
8388 dvlearn_task = GNUNET_SCHEDULER_add_delayed (delay, &start_dv_learn, NULL); 8487 dvlearn_task = GNUNET_SCHEDULER_add_delayed (delay, &start_dv_learn, NULL);
8389 return; 8488 return;
8390 } 8489 }
@@ -8405,6 +8504,9 @@ start_dv_learn (void *cls)
8405 GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_NONCE, 8504 GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_NONCE,
8406 &lle->challenge, 8505 &lle->challenge,
8407 sizeof (lle->challenge)); 8506 sizeof (lle->challenge));
8507 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
8508 "Starting launch DV learn with challenge %s\n",
8509 GNUNET_sh2s (&lle->challenge.value));
8408 GNUNET_CONTAINER_DLL_insert (lle_head, lle_tail, lle); 8510 GNUNET_CONTAINER_DLL_insert (lle_head, lle_tail, lle);
8409 GNUNET_break (GNUNET_YES == 8511 GNUNET_break (GNUNET_YES ==
8410 GNUNET_CONTAINER_multishortmap_put ( 8512 GNUNET_CONTAINER_multishortmap_put (
@@ -8568,7 +8670,11 @@ handle_add_queue_message (void *cls,
8568 } 8670 }
8569 addr_len = ntohs (aqm->header.size) - sizeof (*aqm); 8671 addr_len = ntohs (aqm->header.size) - sizeof (*aqm);
8570 addr = (const char *) &aqm[1]; 8672 addr = (const char *) &aqm[1];
8571 8673 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
8674 "New queue %s to %s available with QID %llu\n",
8675 addr,
8676 GNUNET_i2s (&aqm->receiver),
8677 (unsigned long long) aqm->qid);
8572 queue = GNUNET_malloc (sizeof (struct Queue) + addr_len); 8678 queue = GNUNET_malloc (sizeof (struct Queue) + addr_len);
8573 queue->tc = tc; 8679 queue->tc = tc;
8574 queue->address = (const char *) &queue[1]; 8680 queue->address = (const char *) &queue[1];
@@ -8788,6 +8894,11 @@ start_address_validation (const struct GNUNET_PeerIdentity *pid,
8788 &vs->challenge, 8894 &vs->challenge,
8789 sizeof (vs->challenge)); 8895 sizeof (vs->challenge));
8790 vs->address = GNUNET_strdup (address); 8896 vs->address = GNUNET_strdup (address);
8897 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
8898 "Starting address validation `%s' of peer %s using challenge %s\n",
8899 address,
8900 GNUNET_i2s (pid),
8901 GNUNET_sh2s (&vs->challenge.value));
8791 GNUNET_assert (GNUNET_YES == 8902 GNUNET_assert (GNUNET_YES ==
8792 GNUNET_CONTAINER_multipeermap_put ( 8903 GNUNET_CONTAINER_multipeermap_put (
8793 validation_map, 8904 validation_map,