projects
/
oweals
/
gnunet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixing #3799: only unindex if DB operations succeeded previously in the first place...
[oweals/gnunet.git]
/
src
/
fs
/
gnunet-service-fs_cp.h
diff --git
a/src/fs/gnunet-service-fs_cp.h
b/src/fs/gnunet-service-fs_cp.h
index e3c7cd2278259a8525aece2f1dfc30c062483bfd..3ca27e814dfae4f8b8164e2c7aa4d486392a4fb4 100644
(file)
--- a/
src/fs/gnunet-service-fs_cp.h
+++ b/
src/fs/gnunet-service-fs_cp.h
@@
-1,6
+1,6
@@
/*
This file is part of GNUnet.
/*
This file is part of GNUnet.
- (C) 2011 Christian Grothoff (and other contributing authors)
+
Copyright
(C) 2011 Christian Grothoff (and other contributing authors)
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
@@
-34,18
+34,15
@@
* Maximum number of outgoing messages we queue per peer.
*
* Performance measurements for 2 peer setup for 50 MB file
* Maximum number of outgoing messages we queue per peer.
*
* Performance measurements for 2 peer setup for 50 MB file
- * (
with MAX_DATASTORE_QUEUE = 1 and RETRY_PROBABILITY_INV = 1
):
+ * (
using perf_gnunet_service_fs_p2p
):
*
*
- * 2: 1700 kb/s, 1372 kb/s
- * 8: 2117 kb/s, 1284 kb/s, 1112 kb/s
- * 16: 3500 kb/s, 3200 kb/s, 3388 kb/s
- * 32: 3441 kb/s, 3163 kb/s, 3277 kb/s
- * 128: 1700 kb/s; 2010 kb/s, 3383 kb/s, 1156 kb/s
+ * 24: 2-3 MB/s # ~ 24 MB RAM
+ * 256: 8 MB/s # ~256 MB RAM
*
*
- * Conclusion:
16 seems to be a pretty good value (st
able
- *
and high
performance, no excessive memory use).
+ * Conclusion:
24 should suffice (reason
able
+ * performance, no excessive memory use).
*/
*/
-#define MAX_QUEUE_PER_PEER
16
+#define MAX_QUEUE_PER_PEER
24
/**
* Length of the P2P success tracker. Note that having a very long
/**
* Length of the P2P success tracker. Note that having a very long
@@
-66,11
+63,6
@@
struct GSF_PeerPerformanceData
{
struct GSF_PeerPerformanceData
{
- /**
- * Transport performance data.
- */
- struct GNUNET_ATS_Information *atsi;
-
/**
* List of the last clients for which this peer successfully
* answered a query.
/**
* List of the last clients for which this peer successfully
* answered a query.
@@
-133,9
+125,9
@@
struct GSF_PeerPerformanceData
GNUNET_PEER_Id pid;
/**
GNUNET_PEER_Id pid;
/**
- *
Trus
t rating for this peer
+ *
Respec
t rating for this peer
*/
*/
- uint32_t
trus
t;
+ uint32_t
respec
t;
/**
* Number of pending queries (replies are not counted)
/**
* Number of pending queries (replies are not counted)
@@
-158,23
+150,25
@@
struct GSF_PeerPerformanceData
* @param cp handle to the connected peer record
* @param perf peer performance data
*/
* @param cp handle to the connected peer record
* @param perf peer performance data
*/
-typedef void
(*GSF_ConnectedPeerIterator) (void *cls,
- const struct GNUNET_PeerIdentity *
-
peer, struct GSF_ConnectedPeer * cp
,
- const struct GSF_PeerPerformanceData
-
*
ppd);
+typedef void
+(*GSF_ConnectedPeerIterator) (void *cls,
+
const struct GNUNET_PeerIdentity *peer
,
+ struct GSF_ConnectedPeer *cp,
+
const struct GSF_PeerPerformanceData *
ppd);
/**
* Function called to get a message for transmission.
*
* @param cls closure
/**
* Function called to get a message for transmission.
*
* @param cls closure
- * @param buf_size number of bytes available in buf
+ * @param buf_size number of bytes available in
@a
buf
* @param buf where to copy the message, NULL on error (peer disconnect)
* @param buf where to copy the message, NULL on error (peer disconnect)
- * @return number of bytes copied to
'buf'
, can be 0 (without indicating an error)
+ * @return number of bytes copied to
@a buf
, can be 0 (without indicating an error)
*/
*/
-typedef size_t (*GSF_GetMessageCallback) (void *cls, size_t buf_size,
- void *buf);
+typedef size_t
+(*GSF_GetMessageCallback) (void *cls,
+ size_t buf_size,
+ void *buf);
/**
/**
@@
-182,11
+176,23
@@
typedef size_t (*GSF_GetMessageCallback) (void *cls, size_t buf_size,
*
* @param cls closure
* @param cp handle to the connected peer record
*
* @param cls closure
* @param cp handle to the connected peer record
- * @param success
GNUNET_YES on success,
GNUNET_NO on failure
+ * @param success
#GNUNET_YES on success, #
GNUNET_NO on failure
*/
*/
-typedef void (*GSF_PeerReserveCallback) (void *cls,
- struct GSF_ConnectedPeer * cp,
- int success);
+typedef void
+(*GSF_PeerReserveCallback) (void *cls,
+ struct GSF_ConnectedPeer *cp,
+ int success);
+
+
+/**
+ * Function called after the creation of a connected peer record is complete.
+ *
+ * @param cls closure
+ * @param cp handle to the newly created connected peer record
+ */
+typedef void
+(*GSF_ConnectedPeerCreationCallback) (void *cls,
+ struct GSF_ConnectedPeer *cp);
/**
/**
@@
-200,14
+206,13
@@
struct GSF_PeerTransmitHandle;
* records.
*
* @param peer identity of peer that connected
* records.
*
* @param peer identity of peer that connected
- * @param atsi performance data for the connection
- * @param atsi_count number of records in 'atsi'
- * @return handle to connected peer entry
+ * @param creation_cb callback function when the record is created.
+ * @param creation_cb_cls closure for @creation_cb
*/
*/
-struct GSF_ConnectedPeer *
+void
GSF_peer_connect_handler_ (const struct GNUNET_PeerIdentity *peer,
GSF_peer_connect_handler_ (const struct GNUNET_PeerIdentity *peer,
-
const struct GNUNET_ATS_Information *atsi
,
-
unsigned int atsi_count
);
+
GSF_ConnectedPeerCreationCallback creation_cb
,
+
void *creation_cb_cls
);
/**
/**
@@
-220,6
+225,17
@@
struct GSF_ConnectedPeer *
GSF_peer_get_ (const struct GNUNET_PeerIdentity *peer);
GSF_peer_get_ (const struct GNUNET_PeerIdentity *peer);
+/**
+ * Update the latency information kept for the given peer.
+ *
+ * @param id peer record to update
+ * @param latency current latency value
+ */
+void
+GSF_update_peer_latency_ (const struct GNUNET_PeerIdentity *id,
+ struct GNUNET_TIME_Relative latency);
+
+
/**
* Transmit a message to the given peer as soon as possible.
* If the peer disconnects before the transmission can happen,
/**
* Transmit a message to the given peer as soon as possible.
* If the peer disconnects before the transmission can happen,
@@
-235,9
+251,12
@@
GSF_peer_get_ (const struct GNUNET_PeerIdentity *peer);
* @return handle to cancel request
*/
struct GSF_PeerTransmitHandle *
* @return handle to cancel request
*/
struct GSF_PeerTransmitHandle *
-GSF_peer_transmit_ (struct GSF_ConnectedPeer *cp, int is_query,
- uint32_t priority, struct GNUNET_TIME_Relative timeout,
- size_t size, GSF_GetMessageCallback gmc, void *gmc_cls);
+GSF_peer_transmit_ (struct GSF_ConnectedPeer *cp,
+ int is_query,
+ uint32_t priority,
+ struct GNUNET_TIME_Relative timeout,
+ size_t size, GSF_GetMessageCallback gmc,
+ void *gmc_cls);
/**
/**
@@
-294,17
+313,13
@@
GSF_peer_update_responder_peer_ (struct GSF_ConnectedPeer *cp,
* @param other the other peer involved (sender or receiver, NULL
* for loopback messages where we are both sender and receiver)
* @param message the actual message
* @param other the other peer involved (sender or receiver, NULL
* for loopback messages where we are both sender and receiver)
* @param message the actual message
- * @param atsi performance information
- * @param atsi_count number of records in 'atsi'
- * @return GNUNET_OK to keep the connection open,
- * GNUNET_SYSERR to close it (signal serious error)
+ * @return #GNUNET_OK to keep the connection open,
+ * #GNUNET_SYSERR to close it (signal serious error)
*/
int
GSF_handle_p2p_migration_stop_ (void *cls,
const struct GNUNET_PeerIdentity *other,
*/
int
GSF_handle_p2p_migration_stop_ (void *cls,
const struct GNUNET_PeerIdentity *other,
- const struct GNUNET_MessageHeader *message,
- const struct GNUNET_ATS_Information *atsi,
- unsigned int atsi_count);
+ const struct GNUNET_MessageHeader *message);
/**
/**
@@
-384,7
+399,7
@@
GSF_connected_peer_change_preference_ (struct GSF_ConnectedPeer *cp,
/**
* Obtain the identity of a connected peer.
*
/**
* Obtain the identity of a connected peer.
*
- * @param cp peer to
reserve bandwidth from
+ * @param cp peer to
get identity of
* @param id identity to set (written to)
*/
void
* @param id identity to set (written to)
*/
void
@@
-392,6
+407,17
@@
GSF_connected_peer_get_identity_ (const struct GSF_ConnectedPeer *cp,
struct GNUNET_PeerIdentity *id);
struct GNUNET_PeerIdentity *id);
+/**
+ * Obtain the identity of a connected peer.
+ *
+ * @param cp peer to get identity of
+ * @return reference to peer identity, valid until peer disconnects (!)
+ */
+const struct GNUNET_PeerIdentity *
+GSF_connected_peer_get_identity2_ (const struct GSF_ConnectedPeer *cp);
+
+
+
/**
* Iterate over all connected peers.
*
/**
* Iterate over all connected peers.
*