Skip to content

Commit

Permalink
[tls] Ensure that window change is propagated to plainstream interface
Browse files Browse the repository at this point in the history
The cipherstream xfer_window_changed() message is used to retrigger
the TLS transmit state machine.  If the transmit state machine is
idle, then the window change message will not be propagated to the
plainstream interface.  This can potentially cause the plainstream
interface peer (e.g. httpcore) to block waiting for a window change
message that will never arrive.

Fix by ensuring that the window change message is propagated to the
plainstream interface if the transmit state machine is idle.  (If the
transmit state machine is not idle then the plainstream window will be
zero anyway.)

Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed Mar 24, 2018
1 parent 4152aff commit baaf500
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/net/tls.c
Expand Up @@ -2747,9 +2747,14 @@ static void tls_tx_step ( struct tls_connection *tls ) {
tls->tx_pending &= ~TLS_TX_FINISHED;
}

/* Reschedule process if pending transmissions remain */
if ( tls->tx_pending )
/* Reschedule process if pending transmissions remain,
* otherwise send notification of a window change.
*/
if ( tls->tx_pending ) {
tls_tx_resume ( tls );
} else {
xfer_window_changed ( &tls->plainstream );
}

return;

Expand Down

0 comments on commit baaf500

Please sign in to comment.