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

Submitter:  Simon Goldschmidt <goldsimon>
Submitted:  Sat 20 Feb 2010 05:22:21 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  Feature Request Status:  Fixed
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned 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>
Group administrator
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>
Group administrator
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>
Group Member
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>
Group administrator

 

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

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

    Date Changed by Updated Field Previous Value => Replaced by
    2010-03-06 goldsimon StatusNone Fixed
        Assigned toNone goldsimon
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code