This file is part of GNUnet.
Copyright (C) 2011-2014 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
*/
/**
GNUNET_memcpy (ret, &msg[1], sizeof (struct GSC_TypeMap));
return ret;
case GNUNET_MESSAGE_TYPE_CORE_COMPRESSED_TYPE_MAP:
- GNUNET_STATISTICS_update (GSC_stats, gettext_noop ("# type maps received"),
- 1, GNUNET_NO);
+ GNUNET_STATISTICS_update (GSC_stats,
+ gettext_noop ("# type maps received"),
+ 1,
+ GNUNET_NO);
ret = GNUNET_new (struct GSC_TypeMap);
dlen = sizeof (struct GSC_TypeMap);
if ((Z_OK !=
hdr = GSC_TYPEMAP_compute_type_map_message ();
GNUNET_STATISTICS_update (GSC_stats,
- gettext_noop ("# updates to my type map"), 1,
+ gettext_noop ("# updates to my type map"),
+ 1,
GNUNET_NO);
GSC_SESSIONS_broadcast_typemap (hdr);
GNUNET_free (hdr);
}
if (GNUNET_YES == changed)
{
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Typemap changed, broadcasting!\n");
rehash_typemap ();
broadcast_my_type_map ();
}
GSC_TYPEMAP_remove (const uint16_t *types,
unsigned int tlen)
{
- unsigned int i;
int changed;
changed = GNUNET_NO;
- for (i = 0; i < tlen; i++)
+ for (unsigned int i = 0; i < tlen; i++)
{
if (0 == --map_counters[types[i]])
{
const uint16_t *types,
unsigned int tcnt)
{
- unsigned int i;
-
if (NULL == tmap)
return GNUNET_NO;
if (0 == tcnt)
return GNUNET_YES; /* matches all */
- for (i = 0; i < tcnt; i++)
+ for (unsigned int i = 0; i < tcnt; i++)
if (0 != (tmap->bits[types[i] / 32] & (1 << (types[i] % 32))))
return GNUNET_YES;
return GNUNET_NO;
unsigned int tcnt)
{
struct GSC_TypeMap *ret;
- unsigned int i;
ret = GNUNET_new (struct GSC_TypeMap);
if (NULL != tmap)
GNUNET_memcpy (ret, tmap, sizeof (struct GSC_TypeMap));
- for (i = 0; i < tcnt; i++)
+ for (unsigned int i = 0; i < tcnt; i++)
ret->bits[types[i] / 32] |= (1 << (types[i] % 32));
return ret;
}