tolerate additional IPv4 address now available for gnunet.org
[oweals/gnunet.git] / src / fs / gnunet-service-fs_cp.c
index 817aed257b2d016a4fc06858013f45e78083e25b..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,
@@ -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",