- }
-
- 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);
- xbt_free(task_data);
- MSG_task_destroy(task);
- }
-
- 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);
- xbt_free(task_data);
- MSG_task_destroy(task);
- /*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);
- xbt_free(task_data);
- MSG_task_destroy(task);
- /* TODO
- >> notify my new successor
- >> update my table & predecessors table */
+ break;
+
+ case TASK_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);
+ xbt_free(task_data);
+ MSG_task_destroy(task);
+ break;
+
+ case TASK_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->request_id);
+ xbt_free(task_data);
+ MSG_task_destroy(task);
+ /*TODO :
+ >> notify my new predecessor
+ >> send a notify_predecessors !!
+ */
+ break;
+
+ case TASK_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->request_id);
+ xbt_free(task_data);
+ MSG_task_destroy(task);
+ /* TODO
+ >> notify my new successor
+ >> update my table & predecessors table */
+ break;
+
+ default:
+ CRITICAL1("Received an unexpected task: %d", type);
+ xbt_abort();