lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] lwip 1.4 - no FIN sent!


From: m8847
Subject: [lwip-users] lwip 1.4 - no FIN sent!
Date: Thu, 18 Aug 2011 16:46:42 +0200
User-agent: Roundcube Webmail/0.4.2


Hi,

During this summer, my collegue upgraded lwip from 1.3.1 to 1.4.0 (I think he used 1.4.0 code from June), and while most things looks just great, I have stumbled on a problem (and he's on vacation right now) with shutdown.


Basically, I had a very simple webserver, which used to read from a file, and post back requests to the browser.
I all worked just fine with 1.3.1.

Excerpt of the sending function;

while( (b_read = vfile_read( vfh, temp_buff, HTTP_TEMP_BUFF_SIZE )) )
{
    write ( pc_sock, temp_buff, b_read );
}
shutdown( pc_sock, 0 );

(parser and everything else is stripped)



Well, now, with 1.4.0, the same function never gives a FIN when file is sent. Same code.
Most of (all?) the time, a PSH where sent on the last packet though.
The browser sometimes seamed unhappy about missing FIN, so I tried to change the code a bit;

while( (b_read = vfile_read( vfh, temp_buff, HTTP_TEMP_BUFF_SIZE )) )
{
    so_write ( pc_sock, temp_buff, b_read );
}
shutdown( pc_sock, SHUT_RDWR );
sleep( 100 ); // 100 ms sleep.
close( pc_sock );

And while it works better now (the browser gets a RST with the close() (still no FIN), and understands this way, not to expect any more data), it seams wrong?

Or, is this natural behavior? I get into trouble primarily with Java/Java script stuff, pure html seams to do ok without the FIN.



Any ideas are greatly welcome!

 Micael



reply via email to

[Prev in Thread] Current Thread [Next in Thread]