-static size_t
-transmit_message (void *cls, size_t buf_size, void *buf)
-{
- struct MigrationReadyPeer *peer = cls;
- struct PutMessage *msg;
- uint16_t msize;
-
- peer->th = NULL;
- msg = peer->msg;
- peer->msg = NULL;
- if (buf == NULL)
- {
-#if DEBUG_FS_MIGRATION
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Failed to migrate content to another peer (disconnect)\n");
-#endif
- GNUNET_free (msg);
- return 0;
- }
- msize = ntohs (msg->header.size);
- GNUNET_assert (msize <= buf_size);
- memcpy (buf, msg, msize);
- GNUNET_free (msg);
-#if DEBUG_FS_MIGRATION
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Pushing %u bytes to another peer\n",
- msize);
-#endif
- find_content (peer);
- return msize;
-}