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

fix sender

parent 8f4929de
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -151,7 +151,8 @@ int handle_returning_ack_nack(sender_state_t *state, int socket_fd) ...@@ -151,7 +151,8 @@ int handle_returning_ack_nack(sender_state_t *state, int socket_fd)
state->r_window_size = r_window; state->r_window_size = r_window;
uint8_t upper_bound = (place_last_ack + 1) % WINDOW_SIZE; // The oldest seqnum sended uint8_t upper_bound = (place_last_ack + 1) % WINDOW_SIZE; // The oldest seqnum sended
while (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
{ {
pkt_t *n_pkt = state->buffer[state->tail]; pkt_t *n_pkt = state->buffer[state->tail];
seqnum = pkt_get_seqnum(n_pkt); seqnum = pkt_get_seqnum(n_pkt);
...@@ -162,7 +163,7 @@ int handle_returning_ack_nack(sender_state_t *state, int socket_fd) ...@@ -162,7 +163,7 @@ int handle_returning_ack_nack(sender_state_t *state, int socket_fd)
state->s_window_size++; state->s_window_size++;
state->tail = (state->tail + 1) % WINDOW_SIZE; state->tail = (state->tail + 1) % WINDOW_SIZE;
} } while (state->tail != upper_bound);
// Send back the asked ACK if there is one to send back // Send back the asked ACK if there is one to send back
if (place_last_nack != OUT_OFF_WINDOW) if (place_last_nack != OUT_OFF_WINDOW)
......
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