- for (; cur < piece_count; cur++) {
- task = task_message_data_new(me, first, NULL, 0);
- XBT_DEBUG("Sending (send) from %s into mailbox %s", me, first);
- status = MSG_task_send(task, first);
-
- xbt_assert(status == MSG_OK, "broadcaster_send_file() failed");
+ while (bc->current_piece < bc->piece_count) {
+ task = task_message_data_new(NULL, PIECE_SIZE);
+ XBT_DEBUG("Sending (send) piece %d from %s into mailbox %s", bc->current_piece, me, bc->first);
+ MSG_task_send(task, bc->first);
+ bc->current_piece++;