Procházet zdrojové kódy

[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>
tags/v1.20.1
Michael Brown před 6 roky
rodič
revize
baaf50017d
1 změnil soubory, kde provedl 7 přidání a 2 odebrání
  1. 7
    2
      src/net/tls.c

+ 7
- 2
src/net/tls.c Zobrazit soubor

@@ -2747,9 +2747,14 @@ static void tls_tx_step ( struct tls_connection *tls ) {
2747 2747
 		tls->tx_pending &= ~TLS_TX_FINISHED;
2748 2748
 	}
2749 2749
 
2750
-	/* Reschedule process if pending transmissions remain */
2751
-	if ( tls->tx_pending )
2750
+	/* Reschedule process if pending transmissions remain,
2751
+	 * otherwise send notification of a window change.
2752
+	 */
2753
+	if ( tls->tx_pending ) {
2752 2754
 		tls_tx_resume ( tls );
2755
+	} else {
2756
+		xfer_window_changed ( &tls->plainstream );
2757
+	}
2753 2758
 
2754 2759
 	return;
2755 2760
 

Načítá se…
Zrušit
Uložit