*/
struct ForwardedOperationContext *fopcq_tail;
+/**
+ * Operation queue for open file descriptors
+ */
+struct OperationQueue *GST_opq_openfds;
+
/**
* The size of the host list
*/
GNUNET_CONFIGURATION_destroy (our_config);
/* Free hello cache */
GST_cache_clear ();
+ GNUNET_TESTBED_operation_queue_destroy_ (GST_opq_openfds);
+ GST_opq_openfds = NULL;
}
GNUNET_SERVER_add_handlers (server, message_handlers);
GNUNET_SERVER_disconnect_notify (server, &client_disconnect_cb, NULL);
ss_map = GNUNET_CONTAINER_multihashmap_create (5, GNUNET_NO);
+ GST_opq_openfds = GNUNET_TESTBED_operation_queue_create_ (GST_QLEN_OPENFDS);
shutdown_task_id =
GNUNET_SCHEDULER_add_delayed_with_priority (GNUNET_TIME_UNIT_FOREVER_REL,
GNUNET_SCHEDULER_PRIORITY_IDLE,
*/
#define LIST_GROW_STEP 10
+/**
+ * How long should the operation queue for open file descriptors be?
+ */
+#define GST_QLEN_OPENFDS 512
+
/**
* Default timeout for operations which may take some time
*/
*/
extern struct Slave **GST_slave_list;
+/**
+ * Operation queue for open file descriptors
+ */
+extern struct OperationQueue *GST_opq_openfds;
+
/**
* The size of the peer list
*/
uint32_t p2;
uint32_t peer2_host_id;
+ if (sizeof (struct GNUNET_TESTBED_OverlayConnectMessage)
+ != ntohs (message->size))
+ {
+ GNUNET_break (0);
+ GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
+ return;
+ }
msg = (const struct GNUNET_TESTBED_OverlayConnectMessage *) message;
p1 = ntohl (msg->peer1);
p2 = ntohl (msg->peer2);
- peer2_host_id = ntohl (msg->peer2_host_id);
- GNUNET_assert (p1 < GST_peer_list_size);
- GNUNET_assert (NULL != GST_peer_list[p1]);
+ if ((p1 >= GST_peer_list_size) || (NULL == GST_peer_list[p1]))
+ {
+ GNUNET_break (0);
+ GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
+ return;
+ }
peer = GST_peer_list[p1];
+ peer2_host_id = ntohl (msg->peer2_host_id);
operation_id = GNUNET_ntohll (msg->operation_id);
LOG_DEBUG ("Received overlay connect for peers %u and %u with op id: 0x%llx\n",
p1, p2, operation_id);