buglwIP - A Lightweight TCP/IP stack - Bugs: bug #27117, httpserver_raw sample does not...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #27117: httpserver_raw sample does not call tcp_accepted()

Submitter:  Chris N. Strahm <cstrahm>
Submitted:  Mon 27 Jul 2009 10:52:52 AM UTC
   
 
Category:  TCP Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed Planned Release:  None
lwIP version:  1.3.0

Mon 27 Jul 2009 03:10:56 PM UTC, comment #5: 

Since TCP_LISTEN_BACKLOG defaults to 0, we don't have a problem here unless someone changes that option. Of course, since it's an example APP, we should still insert the call to tcp_accepted.

Checked in.

Simon Goldschmidt <goldsimon>
Group administrator
Mon 27 Jul 2009 02:06:38 PM UTC, comment #4: 

updating the summary to reflect the problem better

Kieran Mansley <kieranm>
Group Member
Mon 27 Jul 2009 11:58:16 AM UTC, comment #3: 

And I'm agree with Kieran, the problem is more in the contrib/apps/httpserver_raw sample...

Frédéric Bernon <fbernon>
Group Member
Mon 27 Jul 2009 11:54:43 AM UTC, comment #2: 

In rawapi.txt, we could read :

- struct tcp_pcb *tcp_listen_with_backlog(struct tcp_pcb *pcb, u8_t backlog)

  Same as tcp_listen, but limits the number of outstanding connections
  in the listen queue to the value specified by the backlog argument.
  To use it, your need to set TCP_LISTEN_BACKLOG=1 in your lwipopts.h.

- void tcp_accepted(struct tcp_pcb *pcb)

  Inform lwIP that an incoming connection has been accepted. This would
  usually be called from the accept callback. This allows lwIP to perform
  housekeeping tasks, such as allowing further incoming connections to be
  queued in the listen backlog.

Frédéric Bernon <fbernon>
Group Member
Mon 27 Jul 2009 11:27:08 AM UTC, comment #1: 

I think I've found where this is supposed to be handled: there is a function called tcp_accepted() that should be called when the connection is accepted.  This is called by the higher layer APIs but with the raw API it looks like it's up to the application to make this call.

I suspect that the real bug here is that the example http server doesn't do this.

Kieran Mansley <kieranm>
Group Member
Mon 27 Jul 2009 10:52:52 AM UTC, original submission:  


#define TCP_LISTEN_BACKLOG 1

Connection count is never decremented, backlog builds up, and TCP dies.

> It seems like closing never decrements the backlog count.
> Something like that.  Is the way it should work?


No. When you accept a connection it should decrement the backlog count, but I can't see anywhere in the code where this is done - looks like you've found a bug.  Could you file a bug on savannah, and for now use the workaround of not specifying TCP_LISTEN_BACKLOG

Kieran


Chris N. Strahm <cstrahm>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by fbernon (Posted a comment)
  • -email is unavailable- added by kieranm (Posted a comment)
  • -email is unavailable- added by cstrahm (Submitted the item)
  • -email is unavailable- added by cstrahm
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-07-27 goldsimon StatusNone Fixed
        Open/ClosedOpen Closed
    2009-07-27 kieranm Summarytcp_listen_with_backlog httpserver_raw sample does not call tcp_accepted()
    2009-07-27 cstrahm Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code