#
#
AC_PREREQ(2.61)
-AC_INIT([gnunet], [0.9.0pre1],[bug-gnunet@gnu.org])
-AM_INIT_AUTOMAKE([gnunet], [0.9.0pre1])
+AC_INIT([gnunet], [0.9.0pre2],[bug-gnunet@gnu.org])
+AM_INIT_AUTOMAKE([gnunet], [0.9.0pre2])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_CONFIG_HEADERS([gnunet_config.h])
*/
GNUNET_SCHEDULER_TaskIdentifier reconnect_task;
+ /**
+ * Number of messages we should queue per target.
+ */
+ unsigned int queue_size;
+
/**
* Number of entries in the handlers array.
*/
* 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
*/
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,
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)
{
GNUNET_assert (ok == 2);
OKPP;
/* connect p2 */
- GNUNET_CORE_connect (p2.cfg,
+ GNUNET_CORE_connect (p2.cfg, 1,
TIMEOUT,
&p2,
&init_notify,
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,
GNUNET_assert (ok == 2);
OKPP;
/* connect p2 */
- GNUNET_CORE_connect (p2.cfg,
+ GNUNET_CORE_connect (p2.cfg, 1,
TIMEOUT,
&p2,
&init_notify,
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,
if (cls == &p1)
{
/* connect p2 */
- GNUNET_CORE_connect (p2.cfg,
+ GNUNET_CORE_connect (p2.cfg, 1,
TIMEOUT,
&p2,
&init_notify,
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,
GNUNET_assert (ok == 2);
OKPP;
/* connect p2 */
- GNUNET_CORE_connect (p2.cfg,
+ GNUNET_CORE_connect (p2.cfg, 1,
TIMEOUT,
&p2,
&init_notify,
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,
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 */
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,
* Connect to the receiving peer
*/
pos->peer2handle = GNUNET_CORE_connect (pos->peer2->cfg,
+ 1,
TIMEOUT,
pos,
&init_notify_peer2,
* Connect to the sending peer
*/
pos->peer1handle = GNUNET_CORE_connect (pos->peer1->cfg,
+ 1,
TIMEOUT,
pos,
&init_notify_peer1,
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;
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,
stats = GNUNET_STATISTICS_create ("hostlist", cfg);
core = GNUNET_CORE_connect (cfg,
+ 1,
GNUNET_TIME_UNIT_FOREVER_REL,
NULL,
&core_init,
if ( NULL != filename) GNUNET_free ( filename );
p->core = GNUNET_CORE_connect (p->cfg,
+ 1,
GNUNET_TIME_UNIT_FOREVER_REL,
NULL,
NULL,
* 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
*/
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,
* @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
* Connect to the receiving peer
*/
pos->peer2handle = GNUNET_CORE_connect (pos->peer2->cfg,
+ 1,
TIMEOUT,
pos,
&init_notify_peer2,
* Connect to the sending peer
*/
pos->peer1handle = GNUNET_CORE_connect (pos->peer1->cfg,
+ 1,
TIMEOUT,
pos,
&init_notify_peer1,
#endif
d->phase = SP_START_CORE;
d->server = GNUNET_CORE_connect (d->cfg,
+ 1,
ARM_START_WAIT,
d,
&testing_init,
#endif
ctx->d1core = GNUNET_CORE_connect (d1->cfg,
+ 1,
timeout,
ctx,
NULL,
#if CONNECT_CORE2
ctx->d2core = GNUNET_CORE_connect (d2->cfg,
+ 1,
timeout,
ctx,
NULL,
GNUNET_assert(ctx->d1core == NULL);
ctx->d1core = GNUNET_CORE_connect (ctx->d1->cfg,
+ 1,
GNUNET_TIME_absolute_get_remaining(ctx->timeout),
ctx,
NULL,
NULL,
NULL);
handle = GNUNET_CORE_connect (cfg,
+ 1,
GNUNET_TIME_UNIT_FOREVER_REL,
NULL,
&core_init,