From baaf50017d1a5e7a5a029a00e1f90ecfcb4336f5 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Sat, 24 Mar 2018 21:44:09 +0000 Subject: [tls] Ensure that window change is propagated to plainstream interface 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 --- src/net/tls.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/net/tls.c b/src/net/tls.c index d28daa43..9d994cd7 100644 --- a/src/net/tls.c +++ b/src/net/tls.c @@ -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; -- cgit v1.2.3-55-g7522