[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r13643 - in gnunet: . src/core src/dht src/dv src/fs src/ho
From: |
gnunet |
Subject: |
[GNUnet-SVN] r13643 - in gnunet: . src/core src/dht src/dv src/fs src/hostlist src/include src/testing src/topology |
Date: |
Thu, 11 Nov 2010 12:05:29 +0100 |
Author: grothoff
Date: 2010-11-11 12:05:29 +0100 (Thu, 11 Nov 2010)
New Revision: 13643
Modified:
gnunet/configure.ac
gnunet/src/core/core_api.c
gnunet/src/core/test_core_api.c
gnunet/src/core/test_core_api_reliability.c
gnunet/src/core/test_core_api_start_only.c
gnunet/src/core/test_core_quota_compliance.c
gnunet/src/dht/gnunet-service-dht.c
gnunet/src/dv/gnunet-service-dv.c
gnunet/src/dv/test_transport_api_dv.c
gnunet/src/fs/gnunet-service-fs.c
gnunet/src/hostlist/gnunet-daemon-hostlist.c
gnunet/src/hostlist/test_gnunet_daemon_hostlist_learning.c
gnunet/src/include/gnunet_core_service.h
gnunet/src/testing/test_testing_topology.c
gnunet/src/testing/testing.c
gnunet/src/topology/gnunet-daemon-topology.c
Log:
adding argument to GNUNET_CORE_connect -- not yet implemented
Modified: gnunet/configure.ac
===================================================================
--- gnunet/configure.ac 2010-11-10 14:26:52 UTC (rev 13642)
+++ gnunet/configure.ac 2010-11-11 11:05:29 UTC (rev 13643)
@@ -21,8 +21,8 @@
#
#
AC_PREREQ(2.61)
-AC_INIT([gnunet], [0.9.0pre1],address@hidden)
-AM_INIT_AUTOMAKE([gnunet], [0.9.0pre1])
+AC_INIT([gnunet], [0.9.0pre2],address@hidden)
+AM_INIT_AUTOMAKE([gnunet], [0.9.0pre2])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_CONFIG_HEADERS([gnunet_config.h])
Modified: gnunet/src/core/core_api.c
===================================================================
--- gnunet/src/core/core_api.c 2010-11-10 14:26:52 UTC (rev 13642)
+++ gnunet/src/core/core_api.c 2010-11-11 11:05:29 UTC (rev 13643)
@@ -129,6 +129,11 @@
GNUNET_SCHEDULER_TaskIdentifier reconnect_task;
/**
+ * Number of messages we should queue per target.
+ */
+ unsigned int queue_size;
+
+ /**
* Number of entries in the handlers array.
*/
unsigned int hcnt;
@@ -722,6 +727,7 @@
* complete (or fail) asynchronously.
*
* @param cfg configuration to use
+ * @param queue_size size of the per-peer message queue
* @param timeout after how long should we give up trying to connect to the
core service?
* @param cls closure for the various callbacks that follow (including
handlers in the handlers array)
* @param init callback to call on timeout or once we have successfully
@@ -743,6 +749,7 @@
*/
struct GNUNET_CORE_Handle *
GNUNET_CORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ unsigned int queue_size,
struct GNUNET_TIME_Relative timeout,
void *cls,
GNUNET_CORE_StartupCallback init,
@@ -769,6 +776,7 @@
h->inbound_hdr_only = inbound_hdr_only;
h->outbound_hdr_only = outbound_hdr_only;
h->handlers = handlers;
+ h->queue_size = queue_size;
h->client_notifications = GNUNET_CLIENT_connect ("core", cfg);
if (h->client_notifications == NULL)
{
Modified: gnunet/src/core/test_core_api.c
===================================================================
--- gnunet/src/core/test_core_api.c 2010-11-10 14:26:52 UTC (rev 13642)
+++ gnunet/src/core/test_core_api.c 2010-11-11 11:05:29 UTC (rev 13643)
@@ -219,7 +219,7 @@
GNUNET_assert (ok == 2);
OKPP;
/* connect p2 */
- GNUNET_CORE_connect (p2.cfg,
+ GNUNET_CORE_connect (p2.cfg, 1,
TIMEOUT,
&p2,
&init_notify,
@@ -310,7 +310,7 @@
OKPP;
setup_peer (&p1, "test_core_api_peer1.conf");
setup_peer (&p2, "test_core_api_peer2.conf");
- GNUNET_CORE_connect (p1.cfg,
+ GNUNET_CORE_connect (p1.cfg, 1,
TIMEOUT,
&p1,
&init_notify,
Modified: gnunet/src/core/test_core_api_reliability.c
===================================================================
--- gnunet/src/core/test_core_api_reliability.c 2010-11-10 14:26:52 UTC (rev
13642)
+++ gnunet/src/core/test_core_api_reliability.c 2010-11-11 11:05:29 UTC (rev
13643)
@@ -365,7 +365,7 @@
GNUNET_assert (ok == 2);
OKPP;
/* connect p2 */
- GNUNET_CORE_connect (p2.cfg,
+ GNUNET_CORE_connect (p2.cfg, 1,
TIMEOUT,
&p2,
&init_notify,
@@ -455,7 +455,7 @@
OKPP;
setup_peer (&p1, "test_core_api_peer1.conf");
setup_peer (&p2, "test_core_api_peer2.conf");
- GNUNET_CORE_connect (p1.cfg,
+ GNUNET_CORE_connect (p1.cfg, 1,
TIMEOUT,
&p1,
&init_notify,
Modified: gnunet/src/core/test_core_api_start_only.c
===================================================================
--- gnunet/src/core/test_core_api_start_only.c 2010-11-10 14:26:52 UTC (rev
13642)
+++ gnunet/src/core/test_core_api_start_only.c 2010-11-11 11:05:29 UTC (rev
13643)
@@ -125,7 +125,7 @@
if (cls == &p1)
{
/* connect p2 */
- GNUNET_CORE_connect (p2.cfg,
+ GNUNET_CORE_connect (p2.cfg, 1,
TIMEOUT,
&p2,
&init_notify,
@@ -172,7 +172,7 @@
OKPP;
setup_peer (&p1, "test_core_api_peer1.conf");
setup_peer (&p2, "test_core_api_peer2.conf");
- GNUNET_CORE_connect (p1.cfg,
+ GNUNET_CORE_connect (p1.cfg, 1,
TIMEOUT,
&p1,
&init_notify,
Modified: gnunet/src/core/test_core_quota_compliance.c
===================================================================
--- gnunet/src/core/test_core_quota_compliance.c 2010-11-10 14:26:52 UTC
(rev 13642)
+++ gnunet/src/core/test_core_quota_compliance.c 2010-11-11 11:05:29 UTC
(rev 13643)
@@ -452,7 +452,7 @@
GNUNET_assert (ok == 2);
OKPP;
/* connect p2 */
- GNUNET_CORE_connect (p2.cfg,
+ GNUNET_CORE_connect (p2.cfg, 1,
TIMEOUT,
&p2,
&init_notify,
@@ -533,7 +533,7 @@
OKPP;
setup_peer (&p1, "test_core_quota_peer1.conf");
setup_peer (&p2, "test_core_quota_peer2.conf");
- GNUNET_CORE_connect (p1.cfg,
+ GNUNET_CORE_connect (p1.cfg, 1,
TIMEOUT,
&p1,
&init_notify,
Modified: gnunet/src/dht/gnunet-service-dht.c
===================================================================
--- gnunet/src/dht/gnunet-service-dht.c 2010-11-10 14:26:52 UTC (rev 13642)
+++ gnunet/src/dht/gnunet-service-dht.c 2010-11-11 11:05:29 UTC (rev 13643)
@@ -4567,7 +4567,8 @@
datacache = GNUNET_DATACACHE_create (cfg, "dhtcache");
GNUNET_SERVER_add_handlers (server, plugin_handlers);
GNUNET_SERVER_disconnect_notify (server, &handle_client_disconnect, NULL);
- coreAPI = GNUNET_CORE_connect (cfg, /* Main configuration */
+ coreAPI = GNUNET_CORE_connect (cfg, /* Main configuration */
+ 1, /* queue size */
GNUNET_TIME_UNIT_FOREVER_REL,
NULL, /* Closure passed to DHT functions */
&core_init, /* Call core_init once
connected */
Modified: gnunet/src/dv/gnunet-service-dv.c
===================================================================
--- gnunet/src/dv/gnunet-service-dv.c 2010-11-10 14:26:52 UTC (rev 13642)
+++ gnunet/src/dv/gnunet-service-dv.c 2010-11-11 11:05:29 UTC (rev 13643)
@@ -2993,6 +2993,7 @@
GNUNET_SERVER_add_handlers (server, plugin_handlers);
coreAPI =
GNUNET_CORE_connect (cfg,
+ 1,
GNUNET_TIME_relative_get_forever(),
NULL, /* FIXME: anything we want to pass around? */
&core_init,
Modified: gnunet/src/dv/test_transport_api_dv.c
===================================================================
--- gnunet/src/dv/test_transport_api_dv.c 2010-11-10 14:26:52 UTC (rev
13642)
+++ gnunet/src/dv/test_transport_api_dv.c 2010-11-11 11:05:29 UTC (rev
13643)
@@ -529,6 +529,7 @@
* Connect to the receiving peer
*/
pos->peer2handle = GNUNET_CORE_connect (pos->peer2->cfg,
+ 1,
TIMEOUT,
pos,
&init_notify_peer2,
@@ -567,6 +568,7 @@
* Connect to the sending peer
*/
pos->peer1handle = GNUNET_CORE_connect (pos->peer1->cfg,
+ 1,
TIMEOUT,
pos,
&init_notify_peer1,
@@ -880,7 +882,14 @@
GNUNET_assert(GNUNET_SYSERR !=
GNUNET_CONTAINER_multihashmap_put(peer_daemon_hash, &id->hashPubKey, d,
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
new_peer = GNUNET_malloc(sizeof(struct PeerContext));
- new_peer->peer_handle = GNUNET_CORE_connect(cfg,
GNUNET_TIME_UNIT_FOREVER_REL, d, NULL, &all_connect_handler, NULL, NULL, NULL,
GNUNET_NO, NULL, GNUNET_NO, no_handlers);
+ new_peer->peer_handle = GNUNET_CORE_connect(cfg,
+ 1,
+ GNUNET_TIME_UNIT_FOREVER_REL,
+ d, NULL,
+ &all_connect_handler,
+ NULL, NULL, NULL,
+ GNUNET_NO, NULL, GNUNET_NO,
+ no_handlers);
new_peer->daemon = d;
new_peer->next = all_peers;
all_peers = new_peer;
Modified: gnunet/src/fs/gnunet-service-fs.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs.c 2010-11-10 14:26:52 UTC (rev 13642)
+++ gnunet/src/fs/gnunet-service-fs.c 2010-11-11 11:05:29 UTC (rev 13643)
@@ -4488,6 +4488,7 @@
peer_request_map = GNUNET_CONTAINER_multihashmap_create (enc);
requests_by_expiration_heap = GNUNET_CONTAINER_heap_create
(GNUNET_CONTAINER_HEAP_ORDER_MIN);
core = GNUNET_CORE_connect (cfg,
+ 1, /* larger? */
GNUNET_TIME_UNIT_FOREVER_REL,
NULL,
NULL,
Modified: gnunet/src/hostlist/gnunet-daemon-hostlist.c
===================================================================
--- gnunet/src/hostlist/gnunet-daemon-hostlist.c 2010-11-10 14:26:52 UTC
(rev 13642)
+++ gnunet/src/hostlist/gnunet-daemon-hostlist.c 2010-11-11 11:05:29 UTC
(rev 13643)
@@ -269,6 +269,7 @@
stats = GNUNET_STATISTICS_create ("hostlist", cfg);
core = GNUNET_CORE_connect (cfg,
+ 1,
GNUNET_TIME_UNIT_FOREVER_REL,
NULL,
&core_init,
Modified: gnunet/src/hostlist/test_gnunet_daemon_hostlist_learning.c
===================================================================
--- gnunet/src/hostlist/test_gnunet_daemon_hostlist_learning.c 2010-11-10
14:26:52 UTC (rev 13642)
+++ gnunet/src/hostlist/test_gnunet_daemon_hostlist_learning.c 2010-11-11
11:05:29 UTC (rev 13643)
@@ -370,6 +370,7 @@
if ( NULL != filename) GNUNET_free ( filename );
p->core = GNUNET_CORE_connect (p->cfg,
+ 1,
GNUNET_TIME_UNIT_FOREVER_REL,
NULL,
NULL,
Modified: gnunet/src/include/gnunet_core_service.h
===================================================================
--- gnunet/src/include/gnunet_core_service.h 2010-11-10 14:26:52 UTC (rev
13642)
+++ gnunet/src/include/gnunet_core_service.h 2010-11-11 11:05:29 UTC (rev
13643)
@@ -179,6 +179,7 @@
* subject to queue size limitations.
*
* @param cfg configuration to use
+ * @param queue_size size of the per-peer message queue
* @param timeout after how long should we give up trying to connect to the
core service?
* @param cls closure for the various callbacks that follow (including
handlers in the handlers array)
* @param init callback to call on timeout or once we have successfully
@@ -215,6 +216,7 @@
*/
struct GNUNET_CORE_Handle *
GNUNET_CORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ unsigned int queue_size,
struct GNUNET_TIME_Relative timeout,
void *cls,
GNUNET_CORE_StartupCallback init,
@@ -384,7 +386,10 @@
* @param target who should receive the message,
* use NULL for this peer (loopback)
* @param notify_size how many bytes of buffer space does notify want?
- * @param notify function to call when buffer space is available
+ * @param notify function to call when buffer space is available;
+ * will be called with NULL on timeout or if the overall queue
+ * for this peer is larger than queue_size and this is currently
+ * the message with the lowest priority
* @param notify_cls closure for notify
* @return non-NULL if the notify callback was queued,
* NULL if we can not even queue the request (insufficient
Modified: gnunet/src/testing/test_testing_topology.c
===================================================================
--- gnunet/src/testing/test_testing_topology.c 2010-11-10 14:26:52 UTC (rev
13642)
+++ gnunet/src/testing/test_testing_topology.c 2010-11-11 11:05:29 UTC (rev
13643)
@@ -521,6 +521,7 @@
* Connect to the receiving peer
*/
pos->peer2handle = GNUNET_CORE_connect (pos->peer2->cfg,
+ 1,
TIMEOUT,
pos,
&init_notify_peer2,
@@ -562,6 +563,7 @@
* Connect to the sending peer
*/
pos->peer1handle = GNUNET_CORE_connect (pos->peer1->cfg,
+ 1,
TIMEOUT,
pos,
&init_notify_peer1,
Modified: gnunet/src/testing/testing.c
===================================================================
--- gnunet/src/testing/testing.c 2010-11-10 14:26:52 UTC (rev 13642)
+++ gnunet/src/testing/testing.c 2010-11-11 11:05:29 UTC (rev 13643)
@@ -544,6 +544,7 @@
#endif
d->phase = SP_START_CORE;
d->server = GNUNET_CORE_connect (d->cfg,
+ 1,
ARM_START_WAIT,
d,
&testing_init,
@@ -1537,6 +1538,7 @@
#endif
ctx->d1core = GNUNET_CORE_connect (d1->cfg,
+ 1,
timeout,
ctx,
NULL,
@@ -1554,6 +1556,7 @@
#if CONNECT_CORE2
ctx->d2core = GNUNET_CORE_connect (d2->cfg,
+ 1,
timeout,
ctx,
NULL,
@@ -1616,6 +1619,7 @@
GNUNET_assert(ctx->d1core == NULL);
ctx->d1core = GNUNET_CORE_connect (ctx->d1->cfg,
+ 1,
GNUNET_TIME_absolute_get_remaining(ctx->timeout),
ctx,
NULL,
Modified: gnunet/src/topology/gnunet-daemon-topology.c
===================================================================
--- gnunet/src/topology/gnunet-daemon-topology.c 2010-11-10 14:26:52 UTC
(rev 13642)
+++ gnunet/src/topology/gnunet-daemon-topology.c 2010-11-11 11:05:29 UTC
(rev 13643)
@@ -1378,6 +1378,7 @@
NULL,
NULL);
handle = GNUNET_CORE_connect (cfg,
+ 1,
GNUNET_TIME_UNIT_FOREVER_REL,
NULL,
&core_init,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r13643 - in gnunet: . src/core src/dht src/dv src/fs src/hostlist src/include src/testing src/topology,
gnunet <=