summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brown2018-03-24 22:44:09 +0100
committerMichael Brown2018-03-24 22:51:07 +0100
commitbaaf50017d1a5e7a5a029a00e1f90ecfcb4336f5 (patch)
tree8d6f1b06025203145917146eecce883f82c3de9b
parent[tls] Rename tls_session to tls_connection (diff)
downloadipxe-baaf50017d1a5e7a5a029a00e1f90ecfcb4336f5.tar.gz
ipxe-baaf50017d1a5e7a5a029a00e1f90ecfcb4336f5.tar.xz
ipxe-baaf50017d1a5e7a5a029a00e1f90ecfcb4336f5.zip
[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 <mcb30@ipxe.org>
-rw-r--r--src/net/tls.c9
1 files 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;