- if (channel == peer_ctx->send_channel)
- { /* Something (but us) killd the channel */
- LOG (GNUNET_ERROR_TYPE_DEBUG,
- "send channel (%s) was destroyed - cleaning up\n",
- GNUNET_i2s (peer));
-
- rem_from_list (&gossip_list,
- &gossip_list_size,
- peer);
- rem_from_list (&pending_pull_reply_list,
- &pending_pull_reply_list_size,
- peer);
- to_file (file_name_view_log,
- "-%s\t(cleanup channel, other peer)",
- GNUNET_i2s_full (peer));
-
- peer_ctx->send_channel = NULL;
- /* Somwewhat {ab,re}use the iterator function */
- /* Cast to void is ok, because it's used as void in peer_remove_cb */
- (void) peer_remove_cb ((void *) channel, peer, peer_ctx);
-
- //if (GNUNET_YES != GNUNET_CONTAINER_multipeermap_remove_all (peer_map, key))
- // LOG (GNUNET_ERROR_TYPE_WARNING, "Removing peer from peer_map failed\n");
- //else
- // GNUNET_free (peer_ctx);
- }
- else if (channel == peer_ctx->recv_channel)
- { /* Other peer doesn't want to send us messages anymore */
- LOG (GNUNET_ERROR_TYPE_DEBUG,
- "Peer %s destroyed recv channel - cleaning up channel\n",
- GNUNET_i2s (peer));
- peer_ctx->recv_channel = NULL;
- }
- else if (NULL == peer_ctx->send_channel &&
- get_peer_flag (peer_ctx, TO_DESTROY))
- { /* We closed the channel to that peer */
- LOG (GNUNET_ERROR_TYPE_DEBUG,
- "send channel (%s) was destroyed by us - cleaning up\n",
- GNUNET_i2s (peer));
-
- rem_from_list (&gossip_list,
- &gossip_list_size,
- peer);
- rem_from_list (&pending_pull_reply_list,
- &pending_pull_reply_list_size,
- peer);