Skip to content

Commit

Permalink
Make sure we remember how much data we sent in the event of a retry
Browse files Browse the repository at this point in the history
If a retry occurs we need to reset s->rlayer.wnum so that next time around
we remember how much data we already sent.
  • Loading branch information
mattcaswell committed Oct 23, 2023
1 parent b6eb95f commit fad1d20
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ssl/record/rec_layer_s3.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,10 @@ int ssl3_write_bytes(SSL *ssl, uint8_t type, const void *buf_, size_t len,
/* Retry needed */
i = HANDLE_RLAYER_WRITE_RETURN(s,
s->rlayer.wrlmethod->retry_write_records(s->rlayer.wrl));
if (i <= 0)
if (i <= 0) {
s->rlayer.wnum = tot;
return i;
}
tot += s->rlayer.wpend_tot;
s->rlayer.wpend_tot = 0;
} /* else no retry required */
Expand All @@ -321,6 +323,7 @@ int ssl3_write_bytes(SSL *ssl, uint8_t type, const void *buf_, size_t len,
i = ssl->method->ssl_dispatch_alert(ssl);
if (i <= 0) {
/* SSLfatal() already called if appropriate */
s->rlayer.wnum = tot;
return i;
}
/* if it went, fall through and send more stuff */
Expand Down

0 comments on commit fad1d20

Please sign in to comment.