lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [bug #27215] http_sent() gives trailing 1 byte len [raw]


From: Chris N. Strahm
Subject: [lwip-devel] [bug #27215] http_sent() gives trailing 1 byte len [raw]
Date: Mon, 10 Aug 2009 13:34:21 +0000
User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Avant Browser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)

URL:
  <http://savannah.nongnu.org/bugs/?27215>

                 Summary: http_sent() gives trailing 1 byte len [raw]
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: cstrahm
            Submitted on: Mon 10 Aug 2009 01:34:20 PM GMT
                Category: TCP
                Severity: 3 - Normal
              Item Group: Feature Request
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: 
            lwIP version: 1.3.0

    _______________________________________________________

Details:

> What does the 1 byte length mean?

It's called, I'm guessing, when the other side processes the FIN.  The sent
callback is called as a result of data being ACKed, which means that buffer
space should be available to send.  It just so happens in this case that the
sequence being acked is the FIN to mark the end of the connection.  This could
probably be improved, as I can see it's confusing and not useful.  Feel free
to file a feature request bug on
savannah.

> Why does close get called twice?

I'm guessing that you're using code based on the httpserver_raw example. If
you look at that source, close_conn() is called for a number of reasons.  The
first is from the http_sent() callback if there's no data left, so almost
certainly being triggered by the behaviour outlined above.  The second is when
it receives a packet and it's either not a GET request, or it's a NULL pbuf. 
You're almost certainly seeing a NULL pbuf passed to the receive callback
which means that the other end has closed the connection.  This is normal, as
you have finished the HTTP
transaction - it's just the way that the other end closing a connection is
signalled through the API.





    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?27215>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/





reply via email to

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