|
@@ -17,7 +17,7 @@
|
|
|
#include "../src/myco-memory.c"
|
|
|
#include "../src/myco-modules.h"
|
|
|
|
|
|
-#define DEBUG 1
|
|
|
+#define DEBUG 0
|
|
|
|
|
|
myco_agent *first_agent = NULL;
|
|
|
myco_resource *first_resource = NULL;
|
|
@@ -284,8 +284,10 @@ int myco_daemon_unregister_resource(message msg) {
|
|
|
int myco_daemon_request_resource(message msg) {
|
|
|
myco_resource *current_resource;
|
|
|
|
|
|
+ // TODO: Uncommented for performance tests...
|
|
|
+ current_resource = myco_daemon_find_resource(msg.resource_name);
|
|
|
// Check if resource exists on this node
|
|
|
- if ((current_resource = myco_daemon_find_resource(msg.resource_name)) != NULL) {
|
|
|
+ /*if ((current_resource = myco_daemon_find_resource(msg.resource_name)) != NULL) {
|
|
|
// Check if agent that requests already owns the resource
|
|
|
if (strcmp(current_resource->agent, msg.agent_name) == 0) {
|
|
|
sprintf(msg.message, "ERROR: resource %s already belongs to agent %s\n", msg.resource_name, msg.agent_name);
|
|
@@ -298,6 +300,7 @@ int myco_daemon_request_resource(message msg) {
|
|
|
myco_send(msg.agent_message_queue_id, msg);
|
|
|
return -1;
|
|
|
}
|
|
|
+*/
|
|
|
|
|
|
// Check if resource resides on same node
|
|
|
// printf("\n The adress is: %s\n", inet_ntoa(*(struct in_addr *)¤t_resource->node_ip));
|
|
@@ -321,7 +324,7 @@ int myco_daemon_request_resource(message msg) {
|
|
|
fprintf(stderr, "ERROR: myco_daemon_request: %s\n", strerror(errno));
|
|
|
return -1;
|
|
|
}
|
|
|
- } else {
|
|
|
+ /*} else {
|
|
|
// Handle case where resource is on another node
|
|
|
// TODO: Request Resource information from indexer
|
|
|
|
|
@@ -335,6 +338,7 @@ int myco_daemon_request_resource(message msg) {
|
|
|
return -1;
|
|
|
}
|
|
|
}
|
|
|
+ */
|
|
|
|
|
|
return 0;
|
|
|
}
|