Retransmit only on last message from prev flight

Be a good network citizen, try to avoid causing congestion by causing a
retransmission explosion.
This commit is contained in:
Manuel Pégourié-Gonnard 2014-10-09 17:56:57 +02:00 committed by Paul Bakker
parent 8a7cf2543a
commit fc572dd4f6

View file

@ -2753,8 +2753,10 @@ static int ssl_prepare_handshake_record( ssl_context *ssl )
if( ssl->handshake != NULL && if( ssl->handshake != NULL &&
recv_msg_seq != ssl->handshake->in_msg_seq ) recv_msg_seq != ssl->handshake->in_msg_seq )
{ {
/* No sane server ever retransmits HelloVerifyRequest */ /* Retransmit only on last message from previous flight, to avoid
if( recv_msg_seq < ssl->handshake->in_flight_start_seq && * too many retransmissions.
* Besides, No sane server ever retransmits HelloVerifyRequest */
if( recv_msg_seq == ssl->handshake->in_flight_start_seq - 1 &&
ssl->in_msg[0] != SSL_HS_HELLO_VERIFY_REQUEST ) ssl->in_msg[0] != SSL_HS_HELLO_VERIFY_REQUEST )
{ {
SSL_DEBUG_MSG( 2, ( "received message from last flight, " SSL_DEBUG_MSG( 2, ( "received message from last flight, "