From: Michael Brown Date: Sat, 24 Mar 2018 21:44:09 +0000 (+0000) Subject: [tls] Ensure that window change is propagated to plainstream interface X-Git-Tag: v1.20.1~88 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=baaf50017d1a5e7a5a029a00e1f90ecfcb4336f5;p=thirdparty%2Fipxe.git [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 --- diff --git a/src/net/tls.c b/src/net/tls.c index d28daa43c..9d994cd77 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;