Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
please sonar: this variable will be overwritten in the next loop cycle
[simgrid.git] / examples / msg / app-bittorrent / peer.c
index 5acba5d..ca5f650 100644 (file)
@@ -189,7 +189,6 @@ int get_peers_data(peer_t peer)
       MSG_comm_destroy(comm_received);
       tracker_task_data_free(data);
       MSG_task_destroy(task_received);
-      comm_received = NULL;
     }
   }
 
@@ -206,8 +205,8 @@ void peer_init(peer_t peer, int id, int seed)
   peer->id = id;
   snprintf(peer->mailbox,MAILBOX_SIZE-1, "%d", id);
   snprintf(peer->mailbox_tracker,MAILBOX_SIZE-1, "tracker_%d", id);
-  peer->peers = xbt_dict_new();
-  peer->active_peers = xbt_dict_new();
+  peer->peers        = xbt_dict_new_homogeneous(NULL);
+  peer->active_peers = xbt_dict_new_homogeneous(NULL);
   peer->hostname = MSG_host_get_name(MSG_host_self());
 
   peer->bitfield = xbt_new(char, FILE_PIECES + 1);
@@ -227,7 +226,7 @@ void peer_init(peer_t peer, int id, int seed)
 
   peer->current_pieces = xbt_dynar_new(sizeof(int), NULL);
 
-  peer->stream = (RngStream)MSG_host_get_property_value(MSG_host_self(), "stream");
+  peer->stream        = (RngStream)MSG_host_get_data(MSG_host_self());
   peer->comm_received = NULL;
 
   peer->round = 0;