#define CLIENT_RETRY_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30)
-/**
+/**
* Handle for a mesh to another peer.
*/
struct MeshHandle;
};
-/**
+/**
* Handle for a mesh to another peer.
*/
struct MeshHandle
/**
* Handle for active write operation, or NULL.
- */
+ */
struct GNUNET_MESH_TransmitHandle *wh;
/**
* Which peer does this mesh go to?
- */
+ */
struct GNUNET_PeerIdentity target;
/**
* Map from peer identities to 'struct MeshHandles' with mesh
* tunnels to those peers.
*/
-static struct GNUNET_CONTAINER_MultiHashMap *mesh_map;
+static struct GNUNET_CONTAINER_MultiPeerMap *mesh_map;
/* ********************* client-side code ************************* */
/**
- * Iterator called on each entry in a waiting map to
+ * Iterator called on each entry in a waiting map to
* move it back to the pending list.
*
* @param cls the 'struct MeshHandle'
{
struct MeshHandle *mh = cls;
struct GSF_MeshRequest *sr = value;
-
+
GNUNET_assert (GNUNET_YES ==
GNUNET_CONTAINER_multihashmap_remove (mh->waiting_map,
key,
mh,
&mh->target,
GNUNET_APPLICATION_TYPE_FS_BLOCK_TRANSFER,
- GNUNET_YES,
+ GNUNET_NO,
GNUNET_YES);
transmit_pending (mh);
}
transmit_pending (mh);
return sizeof (sqm);
}
-
+
/**
* Transmit pending requests via the mesh.
/**
* Reply payload.
- */
+ */
const void *data;
/**
*/
size_t data_size;
- /**
+ /**
* Type of the block.
*/
enum GNUNET_BLOCK_Type type;
-
+
/**
* Did we have a matching query?
*/
/**
- * Iterator called on each entry in a waiting map to
+ * Iterator called on each entry in a waiting map to
* process a result.
*
* @param cls the 'struct HandleReplyClosure'
{
struct HandleReplyClosure *hrc = cls;
struct GSF_MeshRequest *sr = value;
-
+
sr->proc (sr->proc_cls,
hrc->type,
hrc->expiration,
type,
&srm[1], msize, &query))
{
- GNUNET_break_op (0);
+ GNUNET_break_op (0);
reset_mesh_async (mh);
return GNUNET_SYSERR;
}
{
struct MeshHandle *mh;
- mh = GNUNET_CONTAINER_multihashmap_get (mesh_map,
- &target->hashPubKey);
+ mh = GNUNET_CONTAINER_multipeermap_get (mesh_map,
+ target);
if (NULL != mh)
{
if (GNUNET_SCHEDULER_NO_TASK != mh->timeout_task)
mh,
&mh->target,
GNUNET_APPLICATION_TYPE_FS_BLOCK_TRANSFER,
- GNUNET_YES,
+ GNUNET_NO,
GNUNET_YES);
GNUNET_assert (GNUNET_OK ==
- GNUNET_CONTAINER_multihashmap_put (mesh_map,
- &mh->target.hashPubKey,
+ GNUNET_CONTAINER_multipeermap_put (mesh_map,
+ &mh->target,
mh,
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
return mh;
/**
- * Iterator called on each entry in a waiting map to
+ * Iterator called on each entry in a waiting map to
* call the 'proc' continuation and release associated
* resources.
*
*
* @param cls NULL
* @param tunnel tunnel of the disconnecting client
- * @param tunnel_ctx our 'struct MeshClient'
+ * @param tunnel_ctx our 'struct MeshClient'
*/
static void
cleaner_cb (void *cls,
if (GNUNET_SCHEDULER_NO_TASK != mh->reset_task)
GNUNET_SCHEDULER_cancel (mh->reset_task);
GNUNET_assert (GNUNET_OK ==
- GNUNET_CONTAINER_multihashmap_remove (mesh_map,
- &mh->target.hashPubKey,
+ GNUNET_CONTAINER_multipeermap_remove (mesh_map,
+ &mh->target,
mh));
GNUNET_CONTAINER_multihashmap_destroy (mh->waiting_map);
GNUNET_free (mh);
{ NULL, 0, 0 }
};
- mesh_map = GNUNET_CONTAINER_multihashmap_create (16, GNUNET_YES);
+ mesh_map = GNUNET_CONTAINER_multipeermap_create (16, GNUNET_YES);
mesh_handle = GNUNET_MESH_connect (GSF_cfg,
NULL,
NULL,
*/
static int
release_meshs (void *cls,
- const struct GNUNET_HashCode *key,
+ const struct GNUNET_PeerIdentity *key,
void *value)
{
struct MeshHandle *mh = value;
void
GSF_mesh_stop_client ()
{
- GNUNET_CONTAINER_multihashmap_iterate (mesh_map,
+ GNUNET_CONTAINER_multipeermap_iterate (mesh_map,
&release_meshs,
NULL);
- GNUNET_CONTAINER_multihashmap_destroy (mesh_map);
+ GNUNET_CONTAINER_multipeermap_destroy (mesh_map);
mesh_map = NULL;
if (NULL != mesh_handle)
{