Browse Source

TCP limits advertised TCP window to size of application window

obtained via xfer_window().
tags/v0.9.3
Michael Brown 17 years ago
parent
commit
35afb379af
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      src/net/tcp.c

+ 4
- 0
src/net/tcp.c View File

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

Loading…
Cancel
Save