diff options
Diffstat (limited to 'src/social/social_api.c')
-rw-r--r-- | src/social/social_api.c | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/src/social/social_api.c b/src/social/social_api.c index af1d6e57e..04b671120 100644 --- a/src/social/social_api.c +++ b/src/social/social_api.c | |||
@@ -818,6 +818,9 @@ handle_host_enter_request (void *cls, | |||
818 | { | 818 | { |
819 | struct GNUNET_SOCIAL_Host *hst = cls; | 819 | struct GNUNET_SOCIAL_Host *hst = cls; |
820 | 820 | ||
821 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
822 | "handle_host_enter_request\n"); | ||
823 | |||
821 | if (NULL == hst->answer_door_cb) | 824 | if (NULL == hst->answer_door_cb) |
822 | return; | 825 | return; |
823 | 826 | ||
@@ -1042,7 +1045,7 @@ place_cleanup (struct GNUNET_SOCIAL_Place *plc) | |||
1042 | { | 1045 | { |
1043 | struct GNUNET_HashCode place_pub_hash; | 1046 | struct GNUNET_HashCode place_pub_hash; |
1044 | GNUNET_CRYPTO_hash (&plc->pub_key, sizeof (plc->pub_key), &place_pub_hash); | 1047 | GNUNET_CRYPTO_hash (&plc->pub_key, sizeof (plc->pub_key), &place_pub_hash); |
1045 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1048 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
1046 | "%s place cleanup: %s\n", | 1049 | "%s place cleanup: %s\n", |
1047 | GNUNET_YES == plc->is_host ? "host" : "guest", | 1050 | GNUNET_YES == plc->is_host ? "host" : "guest", |
1048 | GNUNET_h2s (&place_pub_hash)); | 1051 | GNUNET_h2s (&place_pub_hash)); |
@@ -1075,19 +1078,17 @@ place_cleanup (struct GNUNET_SOCIAL_Place *plc) | |||
1075 | 1078 | ||
1076 | 1079 | ||
1077 | void | 1080 | void |
1078 | place_disconnect (struct GNUNET_SOCIAL_Place *plc, | 1081 | place_disconnect (struct GNUNET_SOCIAL_Place *plc) |
1079 | GNUNET_ContinuationCallback cb, | ||
1080 | void *cls) | ||
1081 | { | 1082 | { |
1082 | plc->disconnect_cb = cb; | 1083 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
1083 | plc->disconnect_cls = cls; | 1084 | "place_disconnect, plc = %p\n", |
1084 | 1085 | plc); | |
1085 | if (NULL != plc->mq) | 1086 | if (NULL != plc->mq) |
1086 | { | 1087 | { |
1087 | struct GNUNET_MQ_Envelope *env = GNUNET_MQ_get_last_envelope (plc->mq); | 1088 | struct GNUNET_MQ_Envelope *env = GNUNET_MQ_get_last_envelope (plc->mq); |
1088 | if (NULL != env) | 1089 | if (NULL != env) |
1089 | { | 1090 | { |
1090 | GNUNET_MQ_notify_sent (env, (GNUNET_SCHEDULER_TaskCallback) place_cleanup, plc); | 1091 | GNUNET_MQ_notify_sent (env, (GNUNET_SCHEDULER_TaskCallback) place_disconnect, plc); |
1091 | } | 1092 | } |
1092 | else | 1093 | else |
1093 | { | 1094 | { |
@@ -1104,6 +1105,8 @@ place_disconnect (struct GNUNET_SOCIAL_Place *plc, | |||
1104 | void | 1105 | void |
1105 | place_leave (struct GNUNET_SOCIAL_Place *plc) | 1106 | place_leave (struct GNUNET_SOCIAL_Place *plc) |
1106 | { | 1107 | { |
1108 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
1109 | "social_api: place_leave\n"); | ||
1107 | struct GNUNET_MessageHeader *msg; | 1110 | struct GNUNET_MessageHeader *msg; |
1108 | struct GNUNET_MQ_Envelope * | 1111 | struct GNUNET_MQ_Envelope * |
1109 | env = GNUNET_MQ_msg (msg, GNUNET_MESSAGE_TYPE_SOCIAL_PLACE_LEAVE); | 1112 | env = GNUNET_MQ_msg (msg, GNUNET_MESSAGE_TYPE_SOCIAL_PLACE_LEAVE); |
@@ -1580,7 +1583,11 @@ GNUNET_SOCIAL_host_disconnect (struct GNUNET_SOCIAL_Host *hst, | |||
1580 | GNUNET_ContinuationCallback disconnect_cb, | 1583 | GNUNET_ContinuationCallback disconnect_cb, |
1581 | void *cls) | 1584 | void *cls) |
1582 | { | 1585 | { |
1583 | place_disconnect (&hst->plc, disconnect_cb, cls); | 1586 | struct GNUNET_SOCIAL_Place *plc = &hst->plc; |
1587 | |||
1588 | plc->disconnect_cb = disconnect_cb; | ||
1589 | plc->disconnect_cls = cls; | ||
1590 | place_disconnect (plc); | ||
1584 | } | 1591 | } |
1585 | 1592 | ||
1586 | 1593 | ||
@@ -1607,6 +1614,8 @@ GNUNET_SOCIAL_host_leave (struct GNUNET_SOCIAL_Host *hst, | |||
1607 | GNUNET_ContinuationCallback disconnect_cb, | 1614 | GNUNET_ContinuationCallback disconnect_cb, |
1608 | void *cls) | 1615 | void *cls) |
1609 | { | 1616 | { |
1617 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
1618 | "GNUNET_SOCIAL_host_leave\n"); | ||
1610 | GNUNET_SOCIAL_host_announce (hst, "_notice_place_closing", env, NULL, NULL, | 1619 | GNUNET_SOCIAL_host_announce (hst, "_notice_place_closing", env, NULL, NULL, |
1611 | GNUNET_SOCIAL_ANNOUNCE_NONE); | 1620 | GNUNET_SOCIAL_ANNOUNCE_NONE); |
1612 | place_leave (&hst->plc); | 1621 | place_leave (&hst->plc); |
@@ -2028,7 +2037,14 @@ GNUNET_SOCIAL_guest_disconnect (struct GNUNET_SOCIAL_Guest *gst, | |||
2028 | GNUNET_ContinuationCallback disconnect_cb, | 2037 | GNUNET_ContinuationCallback disconnect_cb, |
2029 | void *cls) | 2038 | void *cls) |
2030 | { | 2039 | { |
2031 | place_disconnect (&gst->plc, disconnect_cb, cls); | 2040 | struct GNUNET_SOCIAL_Place *plc = &gst->plc; |
2041 | |||
2042 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
2043 | "GNUNET_SOCIAL_guest_disconnect, gst = %p\n", | ||
2044 | gst); | ||
2045 | plc->disconnect_cb = disconnect_cb; | ||
2046 | plc->disconnect_cls = cls; | ||
2047 | place_disconnect (plc); | ||
2032 | } | 2048 | } |
2033 | 2049 | ||
2034 | 2050 | ||