Skip to content
Extraits de code Groupes Projets
Valider dbd8016e rédigé par Samuel de Meester de Ravestein's avatar Samuel de Meester de Ravestein
Parcourir les fichiers

better DEBUG for sender

parent 52b13c3c
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -72,7 +72,7 @@ int send_pkt(sender_state_t *state, pkt_t *pkt, uint8_t position, int socket_fd)
ssize_t sent = send(socket_fd, packet_to_be_sent, len, 0);
if (sent == -1)
{
ERROR("The sending (using send) of the pkt failed");
ERROR("The sending (using the function send from <sys/socket.h>) of the pkt failed");
return -1;
}
......@@ -151,6 +151,7 @@ int handle_returning_ack_nack(sender_state_t *state, int socket_fd)
state->r_window_size = r_window;
uint8_t upper_bound = (place_last_ack + 1) % WINDOW_SIZE; // The oldest seqnum sended
DEBUG("The sender is cumulatively acknowledging [%d : %d[ (place in the buffer)", state->tail, upper_bound);
// A do while is necessary here in case we want to make a full revolution (ack from 1 to 1 not included for example)
do
{
......@@ -214,7 +215,7 @@ int read_and_send(sender_state_t *state, int sending_fd, int socket_fd)
{
nbr_byte_read = 0;
state->last_pkt_sent = CLOSING_PKT;
DEBUG("The closing pkt has been sent !");
DEBUG("The CLOSING pkt has been sent !");
}
else
{
......@@ -232,7 +233,7 @@ int read_and_send(sender_state_t *state, int sending_fd, int socket_fd)
{
pkt_set_timestamp(pkt, SECOND_TO_LAST_PKT);
state->last_pkt_sent = LAST_DATA_PKT;
DEBUG("The last DATA TYPE is being sent !");
DEBUG("The LAST DATATYPE is being sent !");
}
else
{
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter