tolerate additional IPv4 address now available for gnunet.org
[oweals/gnunet.git] / src / fs / gnunet-service-fs_cp.c
index 3f7783dedd3fb7dc659864114fb3972d85a3c746..a3a52122171614610ff38bc187af2732911e9110 100644 (file)
@@ -2,20 +2,20 @@
      This file is part of GNUnet.
      Copyright (C) 2011, 2016 GNUnet e.V.
 
-     GNUnet is free software; you can redistribute it and/or modify
-     it under the terms of the GNU General Public License as published
-     by the Free Software Foundation; either version 3, or (at your
-     option) any later version.
+     GNUnet is free software: you can redistribute it and/or modify it
+     under the terms of the GNU Affero General Public License as published
+     by the Free Software Foundation, either version 3 of the License,
+     or (at your option) any later version.
 
      GNUnet is distributed in the hope that it will be useful, but
      WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-     General Public License for more details.
+     Affero General Public License for more details.
+    
+     You should have received a copy of the GNU Affero General Public License
+     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-     You should have received a copy of the GNU General Public License
-     along with GNUnet; see the file COPYING.  If not, write to the
-     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-     Boston, MA 02110-1301, USA.
+     SPDX-License-Identifier: AGPL3.0-or-later
 */
 /**
  * @file fs/gnunet-service-fs_cp.c
@@ -588,7 +588,7 @@ GSF_peer_connect_handler (void *cls,
   struct GSF_ConnectedPeer *cp;
 
   if (0 ==
-      GNUNET_CRYPTO_cmp_peer_identity (&GSF_my_id,
+      GNUNET_memcmp (&GSF_my_id,
                                        peer))
     return NULL;
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -620,7 +620,6 @@ GSF_peer_connect_handler (void *cls,
                                "fs",
                                 peer,
                                "respect",
-                                GNUNET_TIME_UNIT_FOREVER_REL,
                                 &peer_respect_cb,
                                 cp);
   GSF_iterate_pending_requests_ (&consider_peer_for_forwarding,
@@ -859,7 +858,7 @@ handle_p2p_reply (void *cls,
   size_t msize;
 
   GNUNET_assert (data_len + sizeof (struct PutMessage) <
-                 GNUNET_SERVER_MAX_MESSAGE_SIZE);
+                 GNUNET_MAX_MESSAGE_SIZE);
   GNUNET_assert (peerreq->pr == pr);
   prd = GSF_pending_request_get_data_ (pr);
   if (NULL == data)
@@ -883,7 +882,7 @@ handle_p2p_reply (void *cls,
                             gettext_noop ("# replies received for other peers"),
                             1, GNUNET_NO);
   msize = sizeof (struct PutMessage) + data_len;
-  if (msize >= GNUNET_SERVER_MAX_MESSAGE_SIZE)
+  if (msize >= GNUNET_MAX_MESSAGE_SIZE)
   {
     GNUNET_break (0);
     return;
@@ -1230,7 +1229,9 @@ handle_p2p_get (void *cls,
                               GNUNET_NO);
     return;
   }
-  if (cp->ppd.pending_replies + cp->delay_queue_size > MAX_QUEUE_PER_PEER)
+  unsigned int queue_size = GNUNET_MQ_get_length (cp->mq);
+  queue_size += cp->ppd.pending_replies + cp->delay_queue_size;
+  if (queue_size > MAX_QUEUE_PER_PEER)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "Peer `%s' has too many replies queued already. Dropping query.\n",