diff options
author | Gabor X Toth <*@tg-x.net> | 2016-08-19 19:58:20 +0000 |
---|---|---|
committer | Gabor X Toth <*@tg-x.net> | 2016-08-19 19:58:20 +0000 |
commit | 794a0b40accc0e21a8f6d1c61ee9aebe7450375f (patch) | |
tree | 4cd6c52c75a31a5a27fae04274955d44f6345c6b /src/psyc | |
parent | 1c0bcf03abca7549482d0d698a22e275a0d9ad6b (diff) | |
download | gnunet-794a0b40accc0e21a8f6d1c61ee9aebe7450375f.tar.gz gnunet-794a0b40accc0e21a8f6d1c61ee9aebe7450375f.zip |
psyc, social
Diffstat (limited to 'src/psyc')
-rw-r--r-- | src/psyc/psyc_api.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/psyc/psyc_api.c b/src/psyc/psyc_api.c index 45e4135a3..ca72a44c0 100644 --- a/src/psyc/psyc_api.c +++ b/src/psyc/psyc_api.c | |||
@@ -573,11 +573,10 @@ channel_disconnect (struct GNUNET_PSYC_Channel *chn, | |||
573 | 573 | ||
574 | if (NULL != chn->mq) | 574 | if (NULL != chn->mq) |
575 | { | 575 | { |
576 | struct GNUNET_MQ_Envelope *last = GNUNET_MQ_get_last_envelope (chn->mq); | 576 | struct GNUNET_MQ_Envelope *env = GNUNET_MQ_get_last_envelope (chn->mq); |
577 | if (NULL != last) | 577 | if (NULL != env) |
578 | { | 578 | { |
579 | GNUNET_MQ_notify_sent (last, | 579 | GNUNET_MQ_notify_sent (env, (GNUNET_MQ_NotifyCallback) channel_cleanup, chn); |
580 | (GNUNET_MQ_NotifyCallback) channel_cleanup, chn); | ||
581 | } | 580 | } |
582 | else | 581 | else |
583 | { | 582 | { |
@@ -619,17 +618,16 @@ master_disconnected (void *cls, enum GNUNET_MQ_Error error) | |||
619 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 618 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
620 | "Master client disconnected (%d), re-connecting\n", | 619 | "Master client disconnected (%d), re-connecting\n", |
621 | (int) error); | 620 | (int) error); |
622 | if (NULL != chn->mq) | ||
623 | { | ||
624 | GNUNET_MQ_destroy (chn->mq); | ||
625 | chn->mq = NULL; | ||
626 | } | ||
627 | if (NULL != chn->tmit) | 621 | if (NULL != chn->tmit) |
628 | { | 622 | { |
629 | GNUNET_PSYC_transmit_destroy (chn->tmit); | 623 | GNUNET_PSYC_transmit_destroy (chn->tmit); |
630 | chn->tmit = NULL; | 624 | chn->tmit = NULL; |
631 | } | 625 | } |
632 | 626 | if (NULL != chn->mq) | |
627 | { | ||
628 | GNUNET_MQ_destroy (chn->mq); | ||
629 | chn->mq = NULL; | ||
630 | } | ||
633 | chn->reconnect_task = GNUNET_SCHEDULER_add_delayed (chn->reconnect_delay, | 631 | chn->reconnect_task = GNUNET_SCHEDULER_add_delayed (chn->reconnect_delay, |
634 | master_reconnect, | 632 | master_reconnect, |
635 | mst); | 633 | mst); |
@@ -919,16 +917,16 @@ slave_disconnected (void *cls, enum GNUNET_MQ_Error error) | |||
919 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 917 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
920 | "Slave client disconnected (%d), re-connecting\n", | 918 | "Slave client disconnected (%d), re-connecting\n", |
921 | (int) error); | 919 | (int) error); |
922 | if (NULL != chn->mq) | ||
923 | { | ||
924 | GNUNET_MQ_destroy (chn->mq); | ||
925 | chn->mq = NULL; | ||
926 | } | ||
927 | if (NULL != chn->tmit) | 920 | if (NULL != chn->tmit) |
928 | { | 921 | { |
929 | GNUNET_PSYC_transmit_destroy (chn->tmit); | 922 | GNUNET_PSYC_transmit_destroy (chn->tmit); |
930 | chn->tmit = NULL; | 923 | chn->tmit = NULL; |
931 | } | 924 | } |
925 | if (NULL != chn->mq) | ||
926 | { | ||
927 | GNUNET_MQ_destroy (chn->mq); | ||
928 | chn->mq = NULL; | ||
929 | } | ||
932 | chn->reconnect_task = GNUNET_SCHEDULER_add_delayed (chn->reconnect_delay, | 930 | chn->reconnect_task = GNUNET_SCHEDULER_add_delayed (chn->reconnect_delay, |
933 | slave_reconnect, | 931 | slave_reconnect, |
934 | slv); | 932 | slv); |