diff options
author | lurchi <lurchi@strangeplace.net> | 2017-11-24 21:58:12 +0100 |
---|---|---|
committer | lurchi <lurchi@strangeplace.net> | 2017-11-24 21:58:12 +0100 |
commit | 130d7e66aea9c9b6ec3955dc9446530057dcb10c (patch) | |
tree | bad0cf973da549b29b5ae98329f14c613d089edb /src/psyc/psyc_api.c | |
parent | fc1b64c4cab95a5b39d64b06707ecf20e615af7f (diff) | |
download | gnunet-130d7e66aea9c9b6ec3955dc9446530057dcb10c.tar.gz gnunet-130d7e66aea9c9b6ec3955dc9446530057dcb10c.zip |
mark channel as disconnectin when a part request is sent; cleanup
Diffstat (limited to 'src/psyc/psyc_api.c')
-rw-r--r-- | src/psyc/psyc_api.c | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/src/psyc/psyc_api.c b/src/psyc/psyc_api.c index cdb9ce881..a045f9eb2 100644 --- a/src/psyc/psyc_api.c +++ b/src/psyc/psyc_api.c | |||
@@ -598,34 +598,6 @@ handle_channel_part_ack (void *cls, | |||
598 | } | 598 | } |
599 | 599 | ||
600 | 600 | ||
601 | //static void | ||
602 | //channel_disconnect (struct GNUNET_PSYC_Channel *chn, | ||
603 | // GNUNET_ContinuationCallback cb, | ||
604 | // void *cls) | ||
605 | //{ | ||
606 | // chn->is_disconnecting = GNUNET_YES; | ||
607 | // chn->disconnect_cb = cb; | ||
608 | // chn->disconnect_cls = cls; | ||
609 | // | ||
610 | // if (NULL != chn->mq) | ||
611 | // { | ||
612 | // struct GNUNET_MQ_Envelope *env = GNUNET_MQ_get_last_envelope (chn->mq); | ||
613 | // if (NULL != env) | ||
614 | // { | ||
615 | // GNUNET_MQ_notify_sent (env, (GNUNET_SCHEDULER_TaskCallback) channel_cleanup, chn); | ||
616 | // } | ||
617 | // else | ||
618 | // { | ||
619 | // channel_cleanup (chn); | ||
620 | // } | ||
621 | // } | ||
622 | // else | ||
623 | // { | ||
624 | // channel_cleanup (chn); | ||
625 | // } | ||
626 | //} | ||
627 | |||
628 | |||
629 | /*** MASTER ***/ | 601 | /*** MASTER ***/ |
630 | 602 | ||
631 | 603 | ||
@@ -800,6 +772,7 @@ GNUNET_PSYC_master_stop (struct GNUNET_PSYC_Master *mst, | |||
800 | struct GNUNET_PSYC_Channel *chn = &mst->chn; | 772 | struct GNUNET_PSYC_Channel *chn = &mst->chn; |
801 | struct GNUNET_MQ_Envelope *env; | 773 | struct GNUNET_MQ_Envelope *env; |
802 | 774 | ||
775 | chn->is_disconnecting = GNUNET_YES; | ||
803 | chn->disconnect_cb = stop_cb; | 776 | chn->disconnect_cb = stop_cb; |
804 | chn->disconnect_cls = stop_cls; | 777 | chn->disconnect_cls = stop_cls; |
805 | env = GNUNET_MQ_msg_header (GNUNET_MESSAGE_TYPE_PSYC_PART_REQUEST); | 778 | env = GNUNET_MQ_msg_header (GNUNET_MESSAGE_TYPE_PSYC_PART_REQUEST); |
@@ -1144,6 +1117,7 @@ GNUNET_PSYC_slave_part (struct GNUNET_PSYC_Slave *slv, | |||
1144 | struct GNUNET_PSYC_Channel *chn = &slv->chn; | 1117 | struct GNUNET_PSYC_Channel *chn = &slv->chn; |
1145 | struct GNUNET_MQ_Envelope *env; | 1118 | struct GNUNET_MQ_Envelope *env; |
1146 | 1119 | ||
1120 | chn->is_disconnecting = GNUNET_YES; | ||
1147 | chn->disconnect_cb = part_cb; | 1121 | chn->disconnect_cb = part_cb; |
1148 | chn->disconnect_cls = part_cls; | 1122 | chn->disconnect_cls = part_cls; |
1149 | env = GNUNET_MQ_msg_header (GNUNET_MESSAGE_TYPE_PSYC_PART_REQUEST); | 1123 | env = GNUNET_MQ_msg_header (GNUNET_MESSAGE_TYPE_PSYC_PART_REQUEST); |