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()

Submitted by:  Chris N. Strahm <cstrahm>
Submitted on:  Mon 27 Jul 2009 10:52:52 AM UTC  
 
Category: TCPSeverity: 3 - Normal
Item Group: Faulty BehaviourStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: ClosedPlanned 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>
Project Administrator
Mon 27 Jul 2009 02:06:38 PM UTC, comment #4:

updating the summary to reflect the problem better

Kieran Mansley <kieranm>
Project Administrator
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>
Project 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>
Project 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>
Project Administrator
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>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 27 Jul 2009 03:10:56 PM UTCgoldsimonStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Mon 27 Jul 2009 02:06:38 PM UTCkieranmSummarytcp_listen_with_backlog=>httpserver_raw sample does not call tcp_accepted()
    Mon 27 Jul 2009 10:52:52 AM UTCcstrahmCarbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1