gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r35320 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r35320 - gnunet/src/transport
Date: Sat, 28 Feb 2015 19:49:25 +0100

Author: grothoff
Date: 2015-02-28 19:49:25 +0100 (Sat, 28 Feb 2015)
New Revision: 35320

Modified:
   gnunet/src/transport/gnunet-service-transport_neighbours.c
   gnunet/src/transport/plugin_transport_tcp.c
   gnunet/src/transport/plugin_transport_udp.c
Log:
call GNUNET_SERVER_receive_done() also on internal error paths

Modified: gnunet/src/transport/gnunet-service-transport_neighbours.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport_neighbours.c  2015-02-28 
18:44:18 UTC (rev 35319)
+++ gnunet/src/transport/gnunet-service-transport_neighbours.c  2015-02-28 
18:49:25 UTC (rev 35320)
@@ -3495,7 +3495,8 @@
                 print_ack_state (n->ack_state));
 
     GNUNET_STATISTICS_update (GST_stats,
-                              gettext_noop ("# unexpected ACK messages"), 1,
+                              gettext_noop ("# unexpected ACK messages"),
+                              1,
                               GNUNET_NO);
     return GNUNET_OK;
   }
@@ -3510,7 +3511,7 @@
                          GNUNET_TRANSPORT_PS_CONNECTED,
                          GNUNET_TIME_relative_to_absolute 
(GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT));
 
-  /* Reset backoff for primary address  */
+  /* Reset backoff for primary address */
   GST_ats_block_reset (n->primary_address.address,
                        n->primary_address.session);
   return GNUNET_OK;

Modified: gnunet/src/transport/plugin_transport_tcp.c
===================================================================
--- gnunet/src/transport/plugin_transport_tcp.c 2015-02-28 18:44:18 UTC (rev 
35319)
+++ gnunet/src/transport/plugin_transport_tcp.c 2015-02-28 18:49:25 UTC (rev 
35320)
@@ -2147,7 +2147,8 @@
   if (ntohs (message->size) != sizeof(struct TCP_NAT_ProbeMessage))
   {
     GNUNET_break_op(0);
-    GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
+    GNUNET_SERVER_receive_done (client,
+                                GNUNET_SYSERR);
     return;
   }
 
@@ -2156,7 +2157,8 @@
           sizeof(struct GNUNET_PeerIdentity)))
   {
     /* refuse connections from ourselves */
-    GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
+    GNUNET_SERVER_receive_done (client,
+                                GNUNET_SYSERR);
     return;
   }
 
@@ -2166,7 +2168,8 @@
   {
     LOG (GNUNET_ERROR_TYPE_DEBUG,
          "Did NOT find session for NAT probe!\n");
-    GNUNET_SERVER_receive_done (client, GNUNET_OK);
+    GNUNET_SERVER_receive_done (client,
+                                GNUNET_OK);
     return;
   }
   LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -2235,7 +2238,8 @@
     LOG(GNUNET_ERROR_TYPE_DEBUG,
         "Bad address for incoming connection!\n");
     GNUNET_free(vaddr);
-    GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
+    GNUNET_SERVER_receive_done (client,
+                                GNUNET_SYSERR);
     tcp_plugin_disconnect_session (plugin,
                                    session);
     return;
@@ -2354,6 +2358,8 @@
       {
         GNUNET_break (0);
         GNUNET_free_non_null (vaddr);
+        GNUNET_SERVER_receive_done (client,
+                                    GNUNET_SYSERR);
         return;
       }
       session = create_session (plugin,
@@ -2391,6 +2397,8 @@
       LOG(GNUNET_ERROR_TYPE_DEBUG,
           "Did not obtain TCP socket address for incoming connection\n");
       GNUNET_break(0);
+      GNUNET_SERVER_receive_done (client,
+                                  GNUNET_SYSERR);
       return;
     }
   }
@@ -2398,7 +2406,8 @@
   if (session->expecting_welcome != GNUNET_YES)
   {
     GNUNET_break_op(0);
-    GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
+    GNUNET_SERVER_receive_done (client,
+                                GNUNET_SYSERR);
     GNUNET_break(0);
     return;
   }
@@ -2408,7 +2417,8 @@
   process_pending_messages (session);
   GNUNET_SERVER_client_set_timeout (client,
                                     GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT);
-  GNUNET_SERVER_receive_done (client, GNUNET_OK);
+  GNUNET_SERVER_receive_done (client,
+                              GNUNET_OK);
 }
 
 
@@ -2502,17 +2512,21 @@
   reschedule_session_timeout (session);
   if (0 == delay.rel_value_us)
   {
-    GNUNET_SERVER_receive_done (client, GNUNET_OK);
+    GNUNET_SERVER_receive_done (client,
+                                GNUNET_OK);
   }
   else
   {
-    LOG(GNUNET_ERROR_TYPE_DEBUG,
-        "Throttling receiving from `%s' for %s\n",
-        GNUNET_i2s (&session->target),
-        GNUNET_STRINGS_relative_time_to_string (delay, GNUNET_YES));
+    LOG (GNUNET_ERROR_TYPE_DEBUG,
+         "Throttling receiving from `%s' for %s\n",
+         GNUNET_i2s (&session->target),
+         GNUNET_STRINGS_relative_time_to_string (delay,
+                                                 GNUNET_YES));
     GNUNET_SERVER_disable_receive_done_warning (client);
+    GNUNET_assert (NULL == session->receive_delay_task);
     session->receive_delay_task = GNUNET_SCHEDULER_add_delayed (delay,
-        &delayed_done, session);
+                                                                &delayed_done,
+                                                                session);
   }
 }
 

Modified: gnunet/src/transport/plugin_transport_udp.c
===================================================================
--- gnunet/src/transport/plugin_transport_udp.c 2015-02-28 18:44:18 UTC (rev 
35319)
+++ gnunet/src/transport/plugin_transport_udp.c 2015-02-28 18:49:25 UTC (rev 
35320)
@@ -1929,7 +1929,9 @@
   else
   {
     GNUNET_STATISTICS_update (plugin->env->stats,
-        "# UDP, total, bytes in buffers", udpw->msg_size, GNUNET_NO);
+                              "# UDP, total, bytes in buffers",
+                              udpw->msg_size,
+                              GNUNET_NO);
     plugin->bytes_in_buffer += udpw->msg_size;
   }
   GNUNET_STATISTICS_update (plugin->env->stats,
@@ -2509,9 +2511,10 @@
 
   flow_delay.rel_value_us = (uint64_t) ntohl (udp_ack->delay);
   LOG (GNUNET_ERROR_TYPE_DEBUG,
-       "We received a sending delay of %s\n",
+       "We received a sending delay of %s for %s\n",
        GNUNET_STRINGS_relative_time_to_string (flow_delay,
-                                               GNUNET_YES));
+                                               GNUNET_YES),
+       GNUNET_i2s (&udp_ack->sender));
   s->flow_delay_from_other_peer = GNUNET_TIME_relative_to_absolute 
(flow_delay);
 
   ack = (const struct GNUNET_MessageHeader *) &udp_ack[1];
@@ -2537,8 +2540,7 @@
   }
 
   LOG (GNUNET_ERROR_TYPE_DEBUG,
-       "Message full ACK'ed\n",
-       (unsigned int ) ntohs (msg->size),
+       "Message from %s at %s full ACK'ed\n",
        GNUNET_i2s (&udp_ack->sender),
        udp_address_to_string (plugin,
                               udp_addr,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]