diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/psyc/psyc_api.c | 28 | ||||
-rw-r--r-- | src/social/gnunet-service-social.c | 2 | ||||
-rw-r--r-- | src/social/social_api.c | 34 | ||||
-rw-r--r-- | src/social/test_social.c | 2 |
4 files changed, 31 insertions, 35 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); |
diff --git a/src/social/gnunet-service-social.c b/src/social/gnunet-service-social.c index 14c457531..01a624e2a 100644 --- a/src/social/gnunet-service-social.c +++ b/src/social/gnunet-service-social.c | |||
@@ -507,7 +507,7 @@ cleanup_guest (struct Guest *gst) | |||
507 | struct Place *plc = &gst->plc; | 507 | struct Place *plc = &gst->plc; |
508 | struct GNUNET_CONTAINER_MultiHashMap * | 508 | struct GNUNET_CONTAINER_MultiHashMap * |
509 | plc_gst = GNUNET_CONTAINER_multihashmap_get (place_guests, | 509 | plc_gst = GNUNET_CONTAINER_multihashmap_get (place_guests, |
510 | &plc->pub_key_hash); | 510 | &plc->pub_key_hash); |
511 | GNUNET_assert (NULL != plc_gst); // FIXME | 511 | GNUNET_assert (NULL != plc_gst); // FIXME |
512 | GNUNET_CONTAINER_multihashmap_remove (plc_gst, &plc->ego_pub_hash, gst); | 512 | GNUNET_CONTAINER_multihashmap_remove (plc_gst, &plc->ego_pub_hash, gst); |
513 | 513 | ||
diff --git a/src/social/social_api.c b/src/social/social_api.c index f73ae17df..e34774aae 100644 --- a/src/social/social_api.c +++ b/src/social/social_api.c | |||
@@ -1075,11 +1075,10 @@ place_disconnect (struct GNUNET_SOCIAL_Place *plc, | |||
1075 | 1075 | ||
1076 | if (NULL != plc->mq) | 1076 | if (NULL != plc->mq) |
1077 | { | 1077 | { |
1078 | struct GNUNET_MQ_Envelope *last = GNUNET_MQ_get_last_envelope (plc->mq); | 1078 | struct GNUNET_MQ_Envelope *env = GNUNET_MQ_get_last_envelope (plc->mq); |
1079 | if (NULL != last) | 1079 | if (NULL != env) |
1080 | { | 1080 | { |
1081 | GNUNET_MQ_notify_sent (last, | 1081 | GNUNET_MQ_notify_sent (env, (GNUNET_MQ_NotifyCallback) place_cleanup, plc); |
1082 | (GNUNET_MQ_NotifyCallback) place_cleanup, plc); | ||
1083 | } | 1082 | } |
1084 | else | 1083 | else |
1085 | { | 1084 | { |
@@ -1132,16 +1131,16 @@ host_disconnected (void *cls, enum GNUNET_MQ_Error error) | |||
1132 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1131 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1133 | "Host client disconnected (%d), re-connecting\n", | 1132 | "Host client disconnected (%d), re-connecting\n", |
1134 | (int) error); | 1133 | (int) error); |
1135 | if (NULL != plc->mq) | ||
1136 | { | ||
1137 | GNUNET_MQ_destroy (plc->mq); | ||
1138 | plc->mq = NULL; | ||
1139 | } | ||
1140 | if (NULL != plc->tmit) | 1134 | if (NULL != plc->tmit) |
1141 | { | 1135 | { |
1142 | GNUNET_PSYC_transmit_destroy (plc->tmit); | 1136 | GNUNET_PSYC_transmit_destroy (plc->tmit); |
1143 | plc->tmit = NULL; | 1137 | plc->tmit = NULL; |
1144 | } | 1138 | } |
1139 | if (NULL != plc->mq) | ||
1140 | { | ||
1141 | GNUNET_MQ_destroy (plc->mq); | ||
1142 | plc->mq = NULL; | ||
1143 | } | ||
1145 | 1144 | ||
1146 | plc->reconnect_task = GNUNET_SCHEDULER_add_delayed (plc->reconnect_delay, | 1145 | plc->reconnect_task = GNUNET_SCHEDULER_add_delayed (plc->reconnect_delay, |
1147 | host_reconnect, | 1146 | host_reconnect, |
@@ -1634,16 +1633,16 @@ guest_disconnected (void *cls, enum GNUNET_MQ_Error error) | |||
1634 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1633 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1635 | "Guest client disconnected (%d), re-connecting\n", | 1634 | "Guest client disconnected (%d), re-connecting\n", |
1636 | (int) error); | 1635 | (int) error); |
1637 | if (NULL != plc->mq) | ||
1638 | { | ||
1639 | GNUNET_MQ_destroy (plc->mq); | ||
1640 | plc->mq = NULL; | ||
1641 | } | ||
1642 | if (NULL != plc->tmit) | 1636 | if (NULL != plc->tmit) |
1643 | { | 1637 | { |
1644 | GNUNET_PSYC_transmit_destroy (plc->tmit); | 1638 | GNUNET_PSYC_transmit_destroy (plc->tmit); |
1645 | plc->tmit = NULL; | 1639 | plc->tmit = NULL; |
1646 | } | 1640 | } |
1641 | if (NULL != plc->mq) | ||
1642 | { | ||
1643 | GNUNET_MQ_destroy (plc->mq); | ||
1644 | plc->mq = NULL; | ||
1645 | } | ||
1647 | 1646 | ||
1648 | plc->reconnect_task = GNUNET_SCHEDULER_add_delayed (plc->reconnect_delay, | 1647 | plc->reconnect_task = GNUNET_SCHEDULER_add_delayed (plc->reconnect_delay, |
1649 | guest_reconnect, | 1648 | guest_reconnect, |
@@ -2690,11 +2689,10 @@ GNUNET_SOCIAL_app_disconnect (struct GNUNET_SOCIAL_App *app, | |||
2690 | 2689 | ||
2691 | if (NULL != app->mq) | 2690 | if (NULL != app->mq) |
2692 | { | 2691 | { |
2693 | struct GNUNET_MQ_Envelope *last = GNUNET_MQ_get_last_envelope (app->mq); | 2692 | struct GNUNET_MQ_Envelope *env = GNUNET_MQ_get_last_envelope (app->mq); |
2694 | if (NULL != last) | 2693 | if (NULL != env) |
2695 | { | 2694 | { |
2696 | GNUNET_MQ_notify_sent (last, | 2695 | GNUNET_MQ_notify_sent (env, (GNUNET_MQ_NotifyCallback) app_cleanup, app); |
2697 | (GNUNET_MQ_NotifyCallback) app_cleanup, app); | ||
2698 | } | 2696 | } |
2699 | else | 2697 | else |
2700 | { | 2698 | { |
diff --git a/src/social/test_social.c b/src/social/test_social.c index 5ab6c83fa..4960b8820 100644 --- a/src/social/test_social.c +++ b/src/social/test_social.c | |||
@@ -1123,7 +1123,7 @@ host_answer_door (void *cls, | |||
1123 | break; | 1123 | break; |
1124 | 1124 | ||
1125 | default: | 1125 | default: |
1126 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "invalid test: %d\n", test); | 1126 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Invalid test: #%u\n", test); |
1127 | GNUNET_assert (0); | 1127 | GNUNET_assert (0); |
1128 | } | 1128 | } |
1129 | } | 1129 | } |