Kaynağa Gözat

TCP limits advertised TCP window to size of application window

obtained via xfer_window().
tags/v0.9.3
Michael Brown 17 yıl önce
ebeveyn
işleme
35afb379af
1 değiştirilmiş dosya ile 4 ekleme ve 0 silme
  1. 4
    0
      src/net/tcp.c

+ 4
- 0
src/net/tcp.c Dosyayı Görüntüle

@@ -363,6 +363,7 @@ static int tcp_xmit ( struct tcp_connection *tcp, int force_send ) {
363 363
 	unsigned int flags;
364 364
 	size_t len = 0;
365 365
 	size_t seq_len;
366
+	size_t app_window;
366 367
 	size_t window;
367 368
 	int rc;
368 369
 
@@ -412,6 +413,9 @@ static int tcp_xmit ( struct tcp_connection *tcp, int force_send ) {
412 413
 	window = ( ( freemem * 3 ) / 4 );
413 414
 	if ( window > TCP_MAX_WINDOW_SIZE )
414 415
 		window = TCP_MAX_WINDOW_SIZE;
416
+	app_window = xfer_window ( &tcp->xfer );
417
+	if ( window > app_window )
418
+		window = app_window;
415 419
 	window &= ~0x03; /* Keep everything dword-aligned */
416 420
 
417 421
 	/* Fill up the TCP header */

Loading…
İptal
Kaydet