buglwIP - A Lightweight TCP/IP stack - Bugs: bug #28945, Simplify the use of tcp_accepted

 
 

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

bug #28945: Simplify the use of tcp_accepted

Submitted by:  Simon Goldschmidt <goldsimon>
Submitted on:  Sat 20 Feb 2010 05:22:21 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: Feature RequestStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned Release: None
lwIP version: CVS Head

Sat 06 Mar 2010 12:07:19 PM UTC, comment #3:

Fixed by letting tcp_accepted() assert for pcb->state == LISTEN

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Mon 22 Feb 2010 12:47:26 PM UTC, comment #2:

OK, the solution might not be the best, but I still think the current implementation could be improved: most people might try to call tcp_accepted() on the connection-pcb passed to the accept callback. I'll add an assert (state == LISTEN) for now.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Mon 22 Feb 2010 11:38:55 AM UTC, comment #1:

I'd like to give this some thought. I'm not convinced that this is the right change to make.

Kieran Mansley <kieranm>
Project Administrator
Sat 20 Feb 2010 05:22:21 PM UTC, original submission:

Currently, using tcp_accepted() is hard to use: it has to be called with the listen-pcb as argument. However, since that listen-pcb is not available in the accept-callback, it has to be set as callback-arg to the listen-pcb when setting it up.

This could be simplified by giving the struct tcp_pcb a pointer to the listen-pcb used to create it (which would be NULL for outgoing connections).

tcp_accepted() could then check the state and dereference this pointer if state != LISTEN.

However, this would mean increasing the pcb by 4 bytes on most platforms (although it is already quite big).

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.

 

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 kieranm (Posted a comment)
  • -unavailable- added by goldsimon (Submitted the item)
  •  

    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 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 06 Mar 2010 12:07:19 PM UTCgoldsimonStatusNone=>Fixed
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1