-/**
- * Write peer-respect information to a file - flush the buffer entry!
- *
- * @param cls unused
- * @param key peer identity
- * @param value the 'struct GSF_ConnectedPeer' to flush
- * @return GNUNET_OK to continue iteration
- */
-static int
-flush_respect (void *cls, const struct GNUNET_PeerIdentity * key, void *value)
-{
- struct GSF_ConnectedPeer *cp = value;
- char *fn;
- uint32_t respect;
- struct GNUNET_PeerIdentity pid;
-
- if (cp->ppd.respect == cp->disk_respect)
- return GNUNET_OK; /* unchanged */
- GNUNET_assert (0 != cp->ppd.pid);
- GNUNET_PEER_resolve (cp->ppd.pid, &pid);
- fn = get_respect_filename (&pid);
- if (cp->ppd.respect == 0)
- {
- if ((0 != UNLINK (fn)) && (errno != ENOENT))
- GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING |
- GNUNET_ERROR_TYPE_BULK, "unlink", fn);
- }
- else
- {
- respect = htonl (cp->ppd.respect);
- if (sizeof (uint32_t) ==
- GNUNET_DISK_fn_write (fn, &respect, sizeof (uint32_t),
- GNUNET_DISK_PERM_USER_READ |
- GNUNET_DISK_PERM_USER_WRITE |
- GNUNET_DISK_PERM_GROUP_READ |
- GNUNET_DISK_PERM_OTHER_READ))
- cp->disk_respect = cp->ppd.respect;
- }
- GNUNET_free (fn);
- return GNUNET_OK;
-}
-
-