aboutsummaryrefslogtreecommitdiff
path: root/src/cadet/gnunet-service-cadet-new_connection.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-01-22 16:49:32 +0100
committerChristian Grothoff <christian@grothoff.org>2017-01-22 16:49:32 +0100
commitc2ed00daf302674f4cf9ffcbdfaa19d38ed57548 (patch)
tree543beb81a46090b1cad0bc335e0cf8116211ca15 /src/cadet/gnunet-service-cadet-new_connection.c
parentaa189e94b593fd5679f328333a3aabef742d9d69 (diff)
downloadgnunet-c2ed00daf302674f4cf9ffcbdfaa19d38ed57548.tar.gz
gnunet-c2ed00daf302674f4cf9ffcbdfaa19d38ed57548.zip
logging fixes, notify MQM clients properly
Diffstat (limited to 'src/cadet/gnunet-service-cadet-new_connection.c')
-rw-r--r--src/cadet/gnunet-service-cadet-new_connection.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/cadet/gnunet-service-cadet-new_connection.c b/src/cadet/gnunet-service-cadet-new_connection.c
index 9b0a2f13b..01fb100c8 100644
--- a/src/cadet/gnunet-service-cadet-new_connection.c
+++ b/src/cadet/gnunet-service-cadet-new_connection.c
@@ -162,7 +162,7 @@ GCC_destroy (struct CadetConnection *cc)
162 struct GNUNET_MQ_Envelope *env = NULL; 162 struct GNUNET_MQ_Envelope *env = NULL;
163 163
164 LOG (GNUNET_ERROR_TYPE_DEBUG, 164 LOG (GNUNET_ERROR_TYPE_DEBUG,
165 "Destroying connection %s\n", 165 "Destroying %s\n",
166 GCC_2s (cc)); 166 GCC_2s (cc));
167 if (CADET_CONNECTION_SENDING_CREATE != cc->state) 167 if (CADET_CONNECTION_SENDING_CREATE != cc->state)
168 { 168 {
@@ -210,7 +210,7 @@ void
210GCC_handle_connection_create_ack (struct CadetConnection *cc) 210GCC_handle_connection_create_ack (struct CadetConnection *cc)
211{ 211{
212 LOG (GNUNET_ERROR_TYPE_DEBUG, 212 LOG (GNUNET_ERROR_TYPE_DEBUG,
213 "Received CREATE_ACK for connection %s in state %d (%s)\n", 213 "Received CREATE_ACK for %s in state %d (%s)\n",
214 GCC_2s (cc), 214 GCC_2s (cc),
215 cc->state, 215 cc->state,
216 (GNUNET_YES == cc->mqm_ready) ? "MQM ready" : "MQM busy"); 216 (GNUNET_YES == cc->mqm_ready) ? "MQM ready" : "MQM busy");
@@ -246,7 +246,7 @@ GCC_handle_kx (struct CadetConnection *cc,
246 /* We didn't get the CREATE_ACK, but instead got payload. That's fine, 246 /* We didn't get the CREATE_ACK, but instead got payload. That's fine,
247 clearly something is working, so pretend we got an ACK. */ 247 clearly something is working, so pretend we got an ACK. */
248 LOG (GNUNET_ERROR_TYPE_DEBUG, 248 LOG (GNUNET_ERROR_TYPE_DEBUG,
249 "Faking connection ACK for connection %s due to KX\n", 249 "Faking connection ACK for %s due to KX\n",
250 GCC_2s (cc)); 250 GCC_2s (cc));
251 GCC_handle_connection_create_ack (cc); 251 GCC_handle_connection_create_ack (cc);
252 } 252 }
@@ -270,7 +270,7 @@ GCC_handle_encrypted (struct CadetConnection *cc,
270 /* We didn't get the CREATE_ACK, but instead got payload. That's fine, 270 /* We didn't get the CREATE_ACK, but instead got payload. That's fine,
271 clearly something is working, so pretend we got an ACK. */ 271 clearly something is working, so pretend we got an ACK. */
272 LOG (GNUNET_ERROR_TYPE_DEBUG, 272 LOG (GNUNET_ERROR_TYPE_DEBUG,
273 "Faking connection ACK for connection %s due to ENCRYPTED payload\n", 273 "Faking connection ACK for %s due to ENCRYPTED payload\n",
274 GCC_2s (cc)); 274 GCC_2s (cc));
275 GCC_handle_connection_create_ack (cc); 275 GCC_handle_connection_create_ack (cc);
276 } 276 }
@@ -306,7 +306,7 @@ send_create (void *cls)
306 pids[i + 1] = *GCP_get_id (GCPP_get_peer_at_offset (cc->path, 306 pids[i + 1] = *GCP_get_id (GCPP_get_peer_at_offset (cc->path,
307 i)); 307 i));
308 LOG (GNUNET_ERROR_TYPE_DEBUG, 308 LOG (GNUNET_ERROR_TYPE_DEBUG,
309 "Sending CONNECTION_CREATE message for connection %s\n", 309 "Sending CONNECTION_CREATE message for %s\n",
310 GCC_2s (cc)); 310 GCC_2s (cc));
311 cc->env = env; 311 cc->env = env;
312 cc->mqm_ready = GNUNET_NO; 312 cc->mqm_ready = GNUNET_NO;
@@ -330,7 +330,7 @@ send_create_ack (void *cls)
330 330
331 cc->task = NULL; 331 cc->task = NULL;
332 LOG (GNUNET_ERROR_TYPE_DEBUG, 332 LOG (GNUNET_ERROR_TYPE_DEBUG,
333 "Sending CONNECTION_CREATE_ACK message for connection %s\n", 333 "Sending CONNECTION_CREATE_ACK message for %s\n",
334 GCC_2s (cc)); 334 GCC_2s (cc));
335 GNUNET_assert (GNUNET_YES == cc->mqm_ready); 335 GNUNET_assert (GNUNET_YES == cc->mqm_ready);
336 env = GNUNET_MQ_msg (ack_msg, 336 env = GNUNET_MQ_msg (ack_msg,
@@ -357,7 +357,7 @@ GCC_handle_duplicate_create (struct CadetConnection *cc)
357 if (GNUNET_YES == cc->mqm_ready) 357 if (GNUNET_YES == cc->mqm_ready)
358 { 358 {
359 LOG (GNUNET_ERROR_TYPE_DEBUG, 359 LOG (GNUNET_ERROR_TYPE_DEBUG,
360 "Got duplicate CREATE for connection %s, scheduling another ACK\n", 360 "Got duplicate CREATE for %s, scheduling another ACK\n",
361 GCC_2s (cc)); 361 GCC_2s (cc));
362 /* Tell tunnel that we are not ready for transmission anymore 362 /* Tell tunnel that we are not ready for transmission anymore
363 (until CREATE_ACK is done) */ 363 (until CREATE_ACK is done) */
@@ -375,7 +375,7 @@ GCC_handle_duplicate_create (struct CadetConnection *cc)
375 can only be an ACK or payload, either of which would 375 can only be an ACK or payload, either of which would
376 do. So actually no need to do anything. */ 376 do. So actually no need to do anything. */
377 LOG (GNUNET_ERROR_TYPE_DEBUG, 377 LOG (GNUNET_ERROR_TYPE_DEBUG,
378 "Got duplicate CREATE for connection %s. MQ is busy, not queueing another ACK\n", 378 "Got duplicate CREATE for %s. MQ is busy, not queueing another ACK\n",
379 GCC_2s (cc)); 379 GCC_2s (cc));
380 } 380 }
381} 381}
@@ -401,7 +401,7 @@ manage_first_hop_mq (void *cls,
401 { 401 {
402 /* Connection is down, for now... */ 402 /* Connection is down, for now... */
403 LOG (GNUNET_ERROR_TYPE_DEBUG, 403 LOG (GNUNET_ERROR_TYPE_DEBUG,
404 "Core MQ for connection %s went down\n", 404 "Core MQ for %s went down\n",
405 GCC_2s (cc)); 405 GCC_2s (cc));
406 cc->mqm_ready = GNUNET_NO; 406 cc->mqm_ready = GNUNET_NO;
407 cc->state = CADET_CONNECTION_NEW; 407 cc->state = CADET_CONNECTION_NEW;
@@ -418,7 +418,7 @@ manage_first_hop_mq (void *cls,
418 418
419 cc->mqm_ready = GNUNET_YES; 419 cc->mqm_ready = GNUNET_YES;
420 LOG (GNUNET_ERROR_TYPE_DEBUG, 420 LOG (GNUNET_ERROR_TYPE_DEBUG,
421 "Core MQ for connection %s became available in state %d\n", 421 "Core MQ for %s became available in state %d\n",
422 GCC_2s (cc), 422 GCC_2s (cc),
423 cc->state); 423 cc->state);
424 switch (cc->state) 424 switch (cc->state)
@@ -495,7 +495,7 @@ connection_create (struct CadetPeer *destination,
495 cc->path = path; 495 cc->path = path;
496 cc->off = off; 496 cc->off = off;
497 LOG (GNUNET_ERROR_TYPE_DEBUG, 497 LOG (GNUNET_ERROR_TYPE_DEBUG,
498 "Creating connection %s using path %s\n", 498 "Creating %s using path %s\n",
499 GCC_2s (cc), 499 GCC_2s (cc),
500 GCPP_2s (path)); 500 GCPP_2s (path));
501 GCPP_add_connection (path, 501 GCPP_add_connection (path,
@@ -646,14 +646,14 @@ GCC_2s (const struct CadetConnection *cc)
646 { 646 {
647 GNUNET_snprintf (buf, 647 GNUNET_snprintf (buf,
648 sizeof (buf), 648 sizeof (buf),
649 "Connection(%s(Tunnel(%s)))", 649 "Connection %s (%s)",
650 GNUNET_sh2s (&cc->cid.connection_of_tunnel), 650 GNUNET_sh2s (&cc->cid.connection_of_tunnel),
651 GCT_2s (cc->ct->t)); 651 GCT_2s (cc->ct->t));
652 return buf; 652 return buf;
653 } 653 }
654 GNUNET_snprintf (buf, 654 GNUNET_snprintf (buf,
655 sizeof (buf), 655 sizeof (buf),
656 "Connection(%s(Tunnel(NULL)))", 656 "Connection %s",
657 GNUNET_sh2s (&cc->cid.connection_of_tunnel)); 657 GNUNET_sh2s (&cc->cid.connection_of_tunnel));
658 return buf; 658 return buf;
659} 659}
@@ -686,7 +686,7 @@ GCC_debug (struct CadetConnection *cc,
686 return; 686 return;
687 } 687 }
688 LOG2 (level, 688 LOG2 (level,
689 "Connection %s to %s via path %s in state %d is %s\n", 689 "%s to %s via path %s in state %d is %s\n",
690 GCC_2s (cc), 690 GCC_2s (cc),
691 GCP_2s (cc->destination), 691 GCP_2s (cc->destination),
692 GCPP_2s (cc->path), 692 GCPP_2s (cc->path),