|
From: | Chris Strahm |
Subject: | [lwip-users] http_sent cb shows 1 byte trailer [RAW] |
Date: | Mon, 10 Aug 2009 05:50:07 -0700 |
Working on getting my server code finished, everything working
pretty good now. However two questions:
After I setup my file to send in http_rcve(), and my send_data() function
starts getting called by lwip, I check the http_sent() cb and inspect the len
parameter. This is suppose to reflect the bytes sent I think.
Showing the debug output from my httpd, I always see a listing at the end
with a length of 1 byte. That seems odd to me. Also, it appears that
the close_conn() function always gets called twice, once with arg pointer
active, and the second time with it NULL. Not sure what to make of
that. This happens with basically all the files whether html, gif, or
jpg. But the web pages display perfectly in both IE and FF even with
fast repeated refreshes. Wireshark shows all Green.
I searched the web about this, and I found an article from BYU that
mentions the same thing I am seeing, about the trailing 1 byte reported by
http_sent(). But they don't really say what the explanation is. I
basically tried their code and didn't see any changes.
Their code has notes about the cb http_sent() "len" parameter being
unreliable.
The debug listing below shows the typically send results on a file.
As you can see there is a listing near the end where http_sent() still has 1
byte remaining. Also, you can see where the close_conn() gets called
twice, the first time with major data remaining.
What does the 1 byte length mean?
Why does close get called twice?
Thanks, Chris.
CON>Sending /lx777.ssi 0x400075cc
CON>Content-length: 20718 CON>max send len 2920 CON>max send len 2920 CON>max send len 2920 CON>max send len 2920 CON>max send len 2920 CON>max send len 2920 CON>max send len 2920 CON>max send len 2920 CON>max send len 2920 CON>max send len 2920 CON>tcp_output CON>http_sent /lx777.ssi 0x400075cc remaining:19258 CON>tcp_output CON>http_sent /lx777.ssi 0x400075cc remaining:17034 CON>tcp_output CON>http_sent /lx777.ssi 0x400075cc remaining:14114 CON>tcp_output CON>http_sent /lx777.ssi 0x400075cc remaining:11958 CON>tcp_output CON>http_sent /lx777.ssi 0x400075cc remaining:9734 CON>tcp_output CON>http_sent /lx777.ssi 0x400075cc remaining:6814 CON>tcp_output CCON>http_sent /lx777.ssi 0x400075cc remaining:4658 CON>tcp_output CON>End of File /lx777.ssi CON>Closing Connection 0x400075cc remaining=4658 (http_state=arg was Active here) CON>http_sent hs=NULL 0x400075cc 2224 (sent, hs now NULL) CON>http_sent hs=NULL 0x400075cc 2434 (sent, hs now NULL) CON>http_sent hs=NULL 0x400075cc 1 (sent, hs now NULL) CON>Closing Connection 0x400075cc (http_state=arg was NULL here) |
lwip_1.pcap
Description: Binary data
[Prev in Thread] | Current Thread | [Next in Thread] |