diff options
author | Bart Polot <bart@net.in.tum.de> | 2015-07-15 11:45:12 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2015-07-15 11:45:12 +0000 |
commit | 860c506ef87aa8324812fa2fca41515c9f8a12fd (patch) | |
tree | bf1a6f98b8c0275f00e1ce7784285dff77a1778f /src | |
parent | be292dcd4d2e4f15f319d00671ce6bd6410bee38 (diff) | |
download | gnunet-860c506ef87aa8324812fa2fca41515c9f8a12fd.tar.gz gnunet-860c506ef87aa8324812fa2fca41515c9f8a12fd.zip |
- let one keepalive be queued at shutdown
Diffstat (limited to 'src')
-rw-r--r-- | src/cadet/gnunet-service-cadet_tunnel.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/cadet/gnunet-service-cadet_tunnel.c b/src/cadet/gnunet-service-cadet_tunnel.c index 226c9a846..aad80af0b 100644 --- a/src/cadet/gnunet-service-cadet_tunnel.c +++ b/src/cadet/gnunet-service-cadet_tunnel.c | |||
@@ -3681,6 +3681,7 @@ GCT_destroy (struct CadetTunnel *t) | |||
3681 | struct CadetTConnection *next_c; | 3681 | struct CadetTConnection *next_c; |
3682 | struct CadetTChannel *iter_ch; | 3682 | struct CadetTChannel *iter_ch; |
3683 | struct CadetTChannel *next_ch; | 3683 | struct CadetTChannel *next_ch; |
3684 | unsigned int keepalives_queued; | ||
3684 | 3685 | ||
3685 | if (NULL == t) | 3686 | if (NULL == t) |
3686 | return; | 3687 | return; |
@@ -3702,16 +3703,28 @@ GCT_destroy (struct CadetTunnel *t) | |||
3702 | GCCH_destroy (iter_ch->ch); | 3703 | GCCH_destroy (iter_ch->ch); |
3703 | /* Should only happen on shutdown, but it's ok. */ | 3704 | /* Should only happen on shutdown, but it's ok. */ |
3704 | } | 3705 | } |
3706 | keepalives_queued = 0; | ||
3705 | while (NULL != t->tq_head) | 3707 | while (NULL != t->tq_head) |
3706 | { | 3708 | { |
3707 | /* Should have been cleaned by destuction of channel. */ | 3709 | /* Should have been cleaned by destuction of channel. */ |
3708 | struct GNUNET_MessageHeader *mh; | 3710 | struct GNUNET_MessageHeader *mh; |
3711 | uint16_t type; | ||
3709 | 3712 | ||
3710 | GNUNET_break (0); | ||
3711 | mh = (struct GNUNET_MessageHeader *) &t->tq_head[1]; | 3713 | mh = (struct GNUNET_MessageHeader *) &t->tq_head[1]; |
3712 | LOG (GNUNET_ERROR_TYPE_WARNING, | 3714 | type = ntohs (mh->type); |
3713 | "message left behind on tunnel shutdown: %s\n", | 3715 | if (0 == keepalives_queued && GNUNET_MESSAGE_TYPE_CADET_KEEPALIVE == type) |
3714 | GC_m2s (ntohs (mh->type))); | 3716 | { |
3717 | keepalives_queued = 1; | ||
3718 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
3719 | "one keepalive left behind on tunnel shutdown\n"); | ||
3720 | } | ||
3721 | else | ||
3722 | { | ||
3723 | GNUNET_break (0); | ||
3724 | LOG (GNUNET_ERROR_TYPE_WARNING, | ||
3725 | "message left behind on tunnel shutdown: %s\n", | ||
3726 | GC_m2s (ntohs (mh->type))); | ||
3727 | } | ||
3715 | unqueue_data (t->tq_head); | 3728 | unqueue_data (t->tq_head); |
3716 | } | 3729 | } |
3717 | 3730 | ||