[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r35342 - gnunet/src/transport
From: |
gnunet |
Subject: |
[GNUnet-SVN] r35342 - gnunet/src/transport |
Date: |
Sat, 7 Mar 2015 11:33:47 +0100 |
Author: grothoff
Date: 2015-03-07 11:33:47 +0100 (Sat, 07 Mar 2015)
New Revision: 35342
Modified:
gnunet/src/transport/gnunet-service-transport_neighbours.c
gnunet/src/transport/plugin_transport_udp.c
Log:
trying to fix #3702 by removing session from session map earlier -- and adding
additional check for messages being enqueued for destroyed sessions
Modified: gnunet/src/transport/gnunet-service-transport_neighbours.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport_neighbours.c 2015-03-03
23:42:55 UTC (rev 35341)
+++ gnunet/src/transport/gnunet-service-transport_neighbours.c 2015-03-07
10:33:47 UTC (rev 35342)
@@ -1282,7 +1282,8 @@
n->is_active = NULL;
if (NULL != n->task)
GNUNET_SCHEDULER_cancel (n->task);
- n->task = GNUNET_SCHEDULER_add_now (&master_task, n);
+ n->task = GNUNET_SCHEDULER_add_now (&master_task,
+ n);
}
if (bytes_in_send_queue < mq->message_buf_size)
{
@@ -1299,14 +1300,14 @@
GNUNET_break (size_payload == mq->message_buf_size);
bytes_in_send_queue -= mq->message_buf_size;
GNUNET_STATISTICS_set (GST_stats,
- gettext_noop
- ("# bytes in message queue for other peers"),
- bytes_in_send_queue, GNUNET_NO);
+ gettext_noop ("# bytes in message queue for other
peers"),
+ bytes_in_send_queue,
+ GNUNET_NO);
if (GNUNET_OK == success)
GNUNET_STATISTICS_update (GST_stats,
- gettext_noop
- ("# messages transmitted to other peers"),
- 1, GNUNET_NO);
+ gettext_noop ("# messages transmitted to other
peers"),
+ 1,
+ GNUNET_NO);
else
GNUNET_STATISTICS_update (GST_stats,
gettext_noop
@@ -1319,7 +1320,10 @@
mq->message_buf_size,
(success == GNUNET_OK) ? "success" : "FAILURE");
if (NULL != mq->cont)
- mq->cont (mq->cont_cls, success, size_payload, physical);
+ mq->cont (mq->cont_cls,
+ success,
+ size_payload,
+ physical);
GNUNET_free (mq);
}
Modified: gnunet/src/transport/plugin_transport_udp.c
===================================================================
--- gnunet/src/transport/plugin_transport_udp.c 2015-03-03 23:42:55 UTC (rev
35341)
+++ gnunet/src/transport/plugin_transport_udp.c 2015-03-07 10:33:47 UTC (rev
35342)
@@ -1456,6 +1456,11 @@
{
struct Session *session = udpw->session;
+ if (GNUNET_YES == session->in_destroy)
+ {
+ GNUNET_break (0);
+ return;
+ }
if (plugin->bytes_in_buffer + udpw->msg_size > INT64_MAX)
{
GNUNET_break (0);
@@ -2174,7 +2179,10 @@
fragmented_message_done (s->frag_ctx,
GNUNET_SYSERR);
}
-
+ GNUNET_assert (GNUNET_YES ==
+ GNUNET_CONTAINER_multipeermap_remove (plugin->sessions,
+ &s->target,
+ s));
frc.rc = NULL;
frc.udp_addr = s->address->address;
frc.udp_addr_len = s->address->address_length;
@@ -2193,6 +2201,7 @@
GNUNET_free (d_ctx);
}
}
+ s->in_destroy = GNUNET_YES;
next = plugin->ipv4_queue_head;
while (NULL != (udpw = next))
{
@@ -2221,13 +2230,6 @@
GNUNET_free (udpw);
}
}
- notify_session_monitor (s->plugin,
- s,
- GNUNET_TRANSPORT_SS_DONE);
- plugin->env->session_end (plugin->env->cls,
- s->address,
- s);
-
if ( (NULL != s->frag_ctx) &&
(NULL != s->frag_ctx->cont) )
{
@@ -2242,23 +2244,18 @@
s->frag_ctx->payload_size,
s->frag_ctx->on_wire_size);
}
-
- GNUNET_assert (GNUNET_YES ==
- GNUNET_CONTAINER_multipeermap_remove (plugin->sessions,
- &s->target,
- s));
+ notify_session_monitor (s->plugin,
+ s,
+ GNUNET_TRANSPORT_SS_DONE);
+ plugin->env->session_end (plugin->env->cls,
+ s->address,
+ s);
GNUNET_STATISTICS_set (plugin->env->stats,
"# UDP sessions active",
GNUNET_CONTAINER_multipeermap_size (plugin->sessions),
GNUNET_NO);
- if (s->rc > 0)
- {
- s->in_destroy = GNUNET_YES;
- }
- else
- {
+ if (0 == s->rc)
free_session (s);
- }
return GNUNET_OK;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r35342 - gnunet/src/transport,
gnunet <=