aboutsummaryrefslogtreecommitdiff
path: root/src/social
diff options
context:
space:
mode:
authorGabor X Toth <*@tg-x.net>2016-08-19 19:58:20 +0000
committerGabor X Toth <*@tg-x.net>2016-08-19 19:58:20 +0000
commit794a0b40accc0e21a8f6d1c61ee9aebe7450375f (patch)
tree4cd6c52c75a31a5a27fae04274955d44f6345c6b /src/social
parent1c0bcf03abca7549482d0d698a22e275a0d9ad6b (diff)
downloadgnunet-794a0b40accc0e21a8f6d1c61ee9aebe7450375f.tar.gz
gnunet-794a0b40accc0e21a8f6d1c61ee9aebe7450375f.zip
psyc, social
Diffstat (limited to 'src/social')
-rw-r--r--src/social/gnunet-service-social.c2
-rw-r--r--src/social/social_api.c34
-rw-r--r--src/social/test_social.c2
3 files changed, 18 insertions, 20 deletions
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}