david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

TCP limits advertised TCP window to size of application window

obtained via xfer_window().
This commit is contained in:
Michael Brown 2007-07-08 14:14:59 +01:00
parent b34d4d0449
commit 35afb379af
1 changed files with 4 additions and 0 deletions

View File

@ -363,6 +363,7 @@ static int tcp_xmit ( struct tcp_connection *tcp, int force_send ) {
unsigned int flags;
size_t len = 0;
size_t seq_len;
size_t app_window;
size_t window;
int rc;
@ -412,6 +413,9 @@ static int tcp_xmit ( struct tcp_connection *tcp, int force_send ) {
window = ( ( freemem * 3 ) / 4 );
if ( window > TCP_MAX_WINDOW_SIZE )
window = TCP_MAX_WINDOW_SIZE;
app_window = xfer_window ( &tcp->xfer );
if ( window > app_window )
window = app_window;
window &= ~0x03; /* Keep everything dword-aligned */
/* Fill up the TCP header */