- }
-
- else if (!strcmp(task_name, "Notify")) {
- // someone is telling me that he may be my new predecessor
- INFO1("Receiving a 'Notify' request from %s", task_data->issuer_host_name);
- notify(node, task_data->request_id);
- }
-
- else if (!strcmp(task_name, "Predecessor Leaving")) {
- // my predecessor is about to quit
- INFO1("Receiving a 'Predecessor Leaving' message from %s", task_data->issuer_host_name);
- // modify my predecessor
- set_predecessor(node, task_data->pred_id);
- /*TODO :
- >> notify my new predecessor
- >> send a notify_predecessors !!
- */
- }
-
- else if (!strcmp(task_name, "Successor Leaving")) {
- // my successor is about to quit
- INFO1("Receiving a 'Successor Leaving' message from %s", task_data->issuer_host_name);
- // modify my successor FIXME : this should be implicit ?
- set_finger(node, 0, task_data->successor_id);
- /* TODO
- >> notify my new successor
- >> update my table & predecessors table */
+ MSG_task_dsend(task, task_data->answer_to, task_free);
+ break;
+
+ case TASK_NOTIFY:
+ // someone is telling me that he may be my new predecessor
+ XBT_DEBUG("Receiving a 'Notify' request from %s", task_data->issuer_host_name);
+ notify(node, task_data->request_id);
+ task_free(task);
+ break;
+
+ case TASK_PREDECESSOR_LEAVING:
+ // my predecessor is about to quit
+ XBT_DEBUG("Receiving a 'Predecessor Leaving' message from %s", task_data->issuer_host_name);
+ // modify my predecessor
+ set_predecessor(node, task_data->request_id);
+ task_free(task);
+ /*TODO :
+ >> notify my new predecessor
+ >> send a notify_predecessors !!
+ */
+ break;
+
+ case TASK_SUCCESSOR_LEAVING:
+ // my successor is about to quit
+ XBT_DEBUG("Receiving a 'Successor Leaving' message from %s", task_data->issuer_host_name);
+ // modify my successor FIXME : this should be implicit ?
+ set_finger(node, 0, task_data->request_id);
+ task_free(task);
+ /* TODO
+ >> notify my new successor
+ >> update my table & predecessors table */
+ break;
+
+ case TASK_FIND_SUCCESSOR_ANSWER:
+ case TASK_GET_PREDECESSOR_ANSWER:
+ XBT_DEBUG("Ignoring unexpected task of type %d (%p)", (int)type, task);
+ task_free(task);
+ break;