clenaer
authorChristian Grothoff <christian@grothoff.org>
Fri, 25 Jun 2010 18:11:37 +0000 (18:11 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 25 Jun 2010 18:11:37 +0000 (18:11 +0000)
src/fs/gnunet-service-fs.c
src/transport/gnunet-service-transport.c
src/transport/plugin_transport_tcp.c
src/transport/plugin_transport_udp.c

index e49ff17cdb0bb539ae97e3ca9c37236eaee19b0a..1eb491877ef81c11c8174ca6f88f74aaf9eead85 100644 (file)
@@ -2672,8 +2672,15 @@ handle_p2p_put (void *cls,
                                              &prq);
   cps = GNUNET_CONTAINER_multihashmap_get (connected_peers,
                                           &other->hashPubKey);
-  cps->inc_preference += CONTENT_BANDWIDTH_VALUE + 1000 * prq.priority;
-  cps->trust_delta += prq.priority;
+  if (cps != NULL)
+    {
+      cps->inc_preference += CONTENT_BANDWIDTH_VALUE + 1000 * prq.priority;
+      cps->trust_delta += prq.priority;
+    }
+  else
+    {
+      GNUNET_break (0);
+    }
   if (GNUNET_YES == active_migration)
     {
 #if DEBUG_FS
index 639252f55a60e47c66254950c1f37342a7ec2451..f9191747e246235fa660c1779944e37ccaa5b2bb 100644 (file)
@@ -57,7 +57,7 @@
  * How many messages can we have pending for a given client process
  * before we start to drop incoming messages?  We typically should
  * have only one client and so this would be the primary buffer for
- * messages, so the number should be chosen rather generously.
 * messages, so the number should be chosen rather generously.
  *
  * The expectation here is that most of the time the queue is large
  * enough so that a drop is virtually never required.  Note that
@@ -3991,6 +3991,9 @@ process_hello (struct TransportPlugin *plugin,
                            gettext_noop ("# HELLOs received for validation"),
                            1,
                            GNUNET_NO);      
+  GNUNET_CRYPTO_hash (&publicKey,
+                      sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded),
+                      &target.hashPubKey);
   /* first, check if load is too high */
   if (GNUNET_SCHEDULER_get_load (sched,
                                 GNUNET_SCHEDULER_PRIORITY_BACKGROUND) > MAX_HELLO_LOAD)
@@ -4019,9 +4022,6 @@ process_hello (struct TransportPlugin *plugin,
       GNUNET_break_op (0);
       return GNUNET_SYSERR;
     }
-  GNUNET_CRYPTO_hash (&publicKey,
-                      sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded),
-                      &target.hashPubKey);
   if (0 == memcmp (&my_identity,
                   &target,
                   sizeof (struct GNUNET_PeerIdentity)))
index bb720124c6d722a62e476981892a9ce826b23015..9b09d894872f63b439016fcdd6bcfcf2a8405dd9 100644 (file)
@@ -791,10 +791,12 @@ disconnect_session (struct Session *session)
     {
       GNUNET_SCHEDULER_cancel (session->plugin->env->sched,
                               session->receive_delay_task);
-      GNUNET_SERVER_receive_done (session->client, 
-                                 GNUNET_SYSERR);       
+      if (session->client != NULL)
+       GNUNET_SERVER_receive_done (session->client, 
+                                   GNUNET_SYSERR);     
     }
-  GNUNET_SERVER_client_drop (session->client);
+  if (session->client != NULL)      
+    GNUNET_SERVER_client_drop (session->client);
   GNUNET_STATISTICS_update (session->plugin->env->stats,
                            gettext_noop ("# TCP sessions active"),
                            -1,
index 0f74ce1286efc3d5b300b1b43c1e696c23c69587..0d01e6c976d37bbbc2a51a1bcc099c01dffa7d47 100644 (file)
@@ -603,6 +603,7 @@ udp_real_send (void *cls,
   else
     {
       GNUNET_break_op (0);
+      GNUNET_free (message);
       return -1;
     }