[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r24639 - in gnunet/src: include testbed
From: |
gnunet |
Subject: |
[GNUnet-SVN] r24639 - in gnunet/src: include testbed |
Date: |
Wed, 31 Oct 2012 16:36:56 +0100 |
Author: harsha
Date: 2012-10-31 16:36:56 +0100 (Wed, 31 Oct 2012)
New Revision: 24639
Modified:
gnunet/src/include/gnunet_protocols.h
gnunet/src/testbed/gnunet-service-testbed.c
gnunet/src/testbed/testbed.h
gnunet/src/testbed/testbed_api.c
Log:
dead code
Modified: gnunet/src/include/gnunet_protocols.h
===================================================================
--- gnunet/src/include/gnunet_protocols.h 2012-10-31 15:21:37 UTC (rev
24638)
+++ gnunet/src/include/gnunet_protocols.h 2012-10-31 15:36:56 UTC (rev
24639)
@@ -1552,16 +1552,10 @@
#define GNUNET_MESSAGE_TYPE_TESTBED_SLAVECONFIG 482
/**
- * Message which is sent from a controller to the testbed API seeking the
configuration
- * of the host whose id is contained in the message.
- */
-#define GNUNET_MESSAGE_TYPE_TESTBED_NEEDCONTROLLERCONFIG 483
-
-/**
* Not really a message, but for careful checks on the testbed messages; Should
* always be the maximum and never be used to send messages with this type
*/
-#define GNUNET_MESSAGE_TYPE_TESTBED_MAX 484
+#define GNUNET_MESSAGE_TYPE_TESTBED_MAX 483
/**
* The initialization message towards gnunet-testbed-helper
Modified: gnunet/src/testbed/gnunet-service-testbed.c
===================================================================
--- gnunet/src/testbed/gnunet-service-testbed.c 2012-10-31 15:21:37 UTC (rev
24638)
+++ gnunet/src/testbed/gnunet-service-testbed.c 2012-10-31 15:36:56 UTC (rev
24639)
@@ -3311,31 +3311,18 @@
if ((peer2_host_id >= slave_list_size)
|| (NULL ==slave_list[peer2_host_id]))
{
- struct GNUNET_TESTBED_NeedControllerConfig *reply;
-
- LOG_DEBUG ("Need controller configuration for connecting peers %u and
%u\n",
- p1, p2);
- reply = GNUNET_malloc (sizeof (struct
- GNUNET_TESTBED_NeedControllerConfig));
- reply->header.size = htons (sizeof (struct
-
GNUNET_TESTBED_NeedControllerConfig));
- reply->header.type = htons
(GNUNET_MESSAGE_TYPE_TESTBED_NEEDCONTROLLERCONFIG);
- reply->controller_host_id = msg->peer2_host_id;
- reply->operation_id = msg->operation_id;
- queue_message (client, &reply->header);
- GNUNET_SERVER_receive_done (client, GNUNET_OK);
+ LOG (GNUNET_ERROR_TYPE_WARNING,
+ "Configuration of peer2's controller missing for connecting peers"
+ "%u and %u\n", p1, p2);
+ GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
return;
}
- else
+ peer2_controller = slave_list[peer2_host_id]->controller;
+ if (NULL == peer2_controller)
{
- //occ->peer2_controller = slave_list[peer2_host_id]->controller;
- peer2_controller = slave_list[peer2_host_id]->controller;
- if (NULL == peer2_controller)
- {
- GNUNET_break (0); /* What's going on? */
- GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
- return;
- }
+ GNUNET_break (0); /* What's going on? */
+ GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
+ return;
}
}
else
Modified: gnunet/src/testbed/testbed.h
===================================================================
--- gnunet/src/testbed/testbed.h 2012-10-31 15:21:37 UTC (rev 24638)
+++ gnunet/src/testbed/testbed.h 2012-10-31 15:36:56 UTC (rev 24639)
@@ -701,29 +701,6 @@
};
-/**
- * Message sent from a controller to the testbed API seeking the configuration
- * of the host whose id is contained in the message.
- */
-struct GNUNET_TESTBED_NeedControllerConfig
-{
- /**
- * Type is GNUNET_MESSAGE_TYPE_TESTBED_NEEDCONTROLLERCONFIG
- */
- struct GNUNET_MessageHeader header;
-
- /**
- * The id of the controller host
- */
- uint32_t controller_host_id GNUNET_PACKED;
-
- /**
- * Operation ID
- */
- uint64_t operation_id GNUNET_PACKED;
-
-};
-
GNUNET_NETWORK_STRUCT_END
#endif
Modified: gnunet/src/testbed/testbed_api.c
===================================================================
--- gnunet/src/testbed/testbed_api.c 2012-10-31 15:21:37 UTC (rev 24638)
+++ gnunet/src/testbed/testbed_api.c 2012-10-31 15:36:56 UTC (rev 24639)
@@ -864,103 +864,6 @@
/**
- * Callback to check status for suboperations generated during overlay connect.
- *
- * @param cls the OverlayConnectData
- * @param message the reply message to the suboperation
- */
-static void
-overlay_connect_ondemand_handler (void *cls,
- const struct GNUNET_MessageHeader *message)
-{
- struct OverlayConnectData *oc_data = cls;
-
- switch (oc_data->state)
- {
- case OCD_CFG_ACQUIRE:
- {
- struct GNUNET_CONFIGURATION_Handle *cfg;
-
- if (GNUNET_MESSAGE_TYPE_TESTBED_SLAVECONFIG != ntohs (message->type))
- {
- GNUNET_break (0); /* treat operation as failed */
- }
- cfg = GNUNET_TESTBED_extract_config_ (message);
- if (NULL == cfg)
- {
- GNUNET_break (0); /* failed operation */
- }
- oc_data->state = OCD_LINK_CONTROLLERS;
- }
- default:
- GNUNET_assert (0);
- }
-}
-
-
-/**
- * Handler for GNUNET_MESSAGE_TYPE_TESTBED_NEEDCONTROLLERCONFIG message from
- * controller (testbed service)
- *
- * @param c the controller handler
- * @param msg message received
- * @return GNUNET_YES if we can continue receiving from service; GNUNET_NO if
- * not
- */
-static int
-handle_need_controller_config (struct GNUNET_TESTBED_Controller *c,
- const struct
GNUNET_TESTBED_NeedControllerConfig * msg)
-{
- struct OperationContext *opc;
- struct OverlayConnectData *oc_data;
- uint64_t op_id;
-
- op_id = GNUNET_ntohll (msg->operation_id);
- if (NULL == (opc = find_opc (c, op_id)))
- {
- LOG_DEBUG ("Operation not found\n");
- return GNUNET_YES;
- }
- if (OP_FORWARDED == opc->type)
- {
- handle_forwarded_operation_msg (c, opc,
- (const struct GNUNET_MessageHeader *) msg);
- return GNUNET_YES;
- }
- GNUNET_assert (OP_OVERLAY_CONNECT == opc->type);
- oc_data = opc->data;
- /* FIXME: Should spawn operations to:
- 1. Acquire configuration of peer2's controller,
- 2. link peer1's controller to peer2's controller
- 3. ask them to attempt overlay connect on peer1 and peer2 again */
- switch (oc_data->state)
- {
- case OCD_INIT:
- {
- struct GNUNET_TESTBED_SlaveGetConfigurationMessage *get_cfg_msg;
- uint64_t sub_op_id;
-
- GNUNET_assert (NULL == oc_data->sub_opc);
- sub_op_id = GNUNET_TESTBED_get_next_op_id (oc_data->p1->controller);
- get_cfg_msg =
- GNUNET_TESTBED_generate_slavegetconfig_msg_
- (sub_op_id, GNUNET_TESTBED_host_get_id_ (oc_data->p2->host));
- oc_data->state = OCD_CFG_ACQUIRE;
- oc_data->sub_opc =
- GNUNET_TESTBED_forward_operation_msg_ (oc_data->p1->controller,
- sub_op_id,
&get_cfg_msg->header,
-
overlay_connect_ondemand_handler,
- oc_data);
- }
- break;
- default:
- GNUNET_assert (0);
- }
- return GNUNET_YES;
-}
-
-
-/**
* Handler for messages from controller (testbed service)
*
* @param cls the controller handler
@@ -1054,14 +957,6 @@
handle_slave_config (c, (const struct
GNUNET_TESTBED_SlaveConfiguration *) msg);
break;
- case GNUNET_MESSAGE_TYPE_TESTBED_NEEDCONTROLLERCONFIG:
- GNUNET_assert (msize == sizeof (struct
- GNUNET_TESTBED_NeedControllerConfig));
- status =
- handle_need_controller_config (c, (const struct
- GNUNET_TESTBED_NeedControllerConfig
- *) msg);
- break;
default:
GNUNET_assert (0);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r24639 - in gnunet/src: include testbed,
gnunet <=