diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-10-26 18:07:37 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-10-26 18:07:37 +0000 |
commit | be98885538291da444b6558f9168e59ac5183440 (patch) | |
tree | 0a4bcec76684dc269e2b42b233b89f748e067c1c /src/transport/test_transport_api_reliability.c | |
parent | 439ed1a79cc8b11a546656f406c0819a65330ae5 (diff) | |
download | gnunet-be98885538291da444b6558f9168e59ac5183440.tar.gz gnunet-be98885538291da444b6558f9168e59ac5183440.zip |
-fix udp transmission, avoid scheduling when unready
Diffstat (limited to 'src/transport/test_transport_api_reliability.c')
-rw-r--r-- | src/transport/test_transport_api_reliability.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/transport/test_transport_api_reliability.c b/src/transport/test_transport_api_reliability.c index c95729ab9..0b80477bf 100644 --- a/src/transport/test_transport_api_reliability.c +++ b/src/transport/test_transport_api_reliability.c | |||
@@ -393,8 +393,10 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
393 | #if VERBOSE | 393 | #if VERBOSE |
394 | if (ntohl (hdr->num) % 5 == 0) | 394 | if (ntohl (hdr->num) % 5 == 0) |
395 | { | 395 | { |
396 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Got message %u of size %u\n", | 396 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
397 | ntohl (hdr->num), ntohs (message->size)); | 397 | "Got message %u of size %u\n", |
398 | ntohl (hdr->num), | ||
399 | ntohs (message->size)); | ||
398 | } | 400 | } |
399 | #endif | 401 | #endif |
400 | n++; | 402 | n++; |
@@ -505,7 +507,8 @@ notify_ready (void *cls, size_t size, void *buf) | |||
505 | static void | 507 | static void |
506 | notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer) | 508 | notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer) |
507 | { | 509 | { |
508 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer `%4s' connected to us (%p)!\n", | 510 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
511 | "Peer `%4s' connected to us (%p)!\n", | ||
509 | GNUNET_i2s (peer), cls); | 512 | GNUNET_i2s (peer), cls); |
510 | } | 513 | } |
511 | 514 | ||
@@ -513,7 +516,8 @@ notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer) | |||
513 | static void | 516 | static void |
514 | notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer) | 517 | notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer) |
515 | { | 518 | { |
516 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer `%4s' disconnected (%p)!\n", | 519 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
520 | "Peer `%4s' disconnected (%p)!\n", | ||
517 | GNUNET_i2s (peer), cls); | 521 | GNUNET_i2s (peer), cls); |
518 | if (th != NULL) | 522 | if (th != NULL) |
519 | GNUNET_TRANSPORT_notify_transmit_ready_cancel (th); | 523 | GNUNET_TRANSPORT_notify_transmit_ready_cancel (th); |
@@ -522,7 +526,8 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer) | |||
522 | 526 | ||
523 | 527 | ||
524 | static void | 528 | static void |
525 | sendtask () | 529 | sendtask (void *cls, |
530 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
526 | { | 531 | { |
527 | start_time = GNUNET_TIME_absolute_get (); | 532 | start_time = GNUNET_TIME_absolute_get (); |
528 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 533 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -533,13 +538,17 @@ sendtask () | |||
533 | NULL); | 538 | NULL); |
534 | } | 539 | } |
535 | 540 | ||
541 | |||
536 | static void | 542 | static void |
537 | testing_connect_cb (struct PeerContext *p1, struct PeerContext *p2, void *cls) | 543 | testing_connect_cb (struct PeerContext *p1, |
544 | struct PeerContext *p2, | ||
545 | void *cls) | ||
538 | { | 546 | { |
539 | char *p1_c = GNUNET_strdup (GNUNET_i2s (&p1->id)); | 547 | char *p1_c = GNUNET_strdup (GNUNET_i2s (&p1->id)); |
540 | 548 | ||
541 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 549 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
542 | "Peers connected: %s <-> %s\n", p1_c, | 550 | "Peers connected: %s <-> %s\n", |
551 | p1_c, | ||
543 | GNUNET_i2s (&p2->id)); | 552 | GNUNET_i2s (&p2->id)); |
544 | GNUNET_free (p1_c); | 553 | GNUNET_free (p1_c); |
545 | 554 | ||