buglwIP - A Lightweight TCP/IP stack - Bugs: bug #45159, Is this part of do_writemore() in...

 
 

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

bug #45159: Is this part of do_writemore() in api_msg.c correct?

Submitter:  Roberto Barbieri Carrera <sebulain>
Submitted:  Thu 21 May 2015 09:23:53 AM UTC
   
 
Category:  TCP Severity:  3 - Normal
Item Group:  None Status:  Invalid
Privacy:  Public Assigned to:  None
Open/Closed:  Closed Planned Release:  None
lwIP version:  1.4.1

Thu 21 May 2015 02:12:56 PM UTC, comment #5: 

Sure, thanks.

Kind regards,
Roberto Barbieri Carrera
Archwave AG

Roberto Barbieri Carrera <sebulain>
Thu 21 May 2015 02:11:23 PM UTC, comment #4: 


> So if conn->write_offset is not zero at the beginning


My point was that in this case (remember that 'dontblock' must be true), write_offset will always be zero.

Simon Goldschmidt <goldsimon>
Group administrator
Thu 21 May 2015 01:59:07 PM UTC, comment #3: 

Sorry, I meant
"
the expression

((conn->write_offset + len) < conn->current_msg->msg.w.len)

looks correct to me.
"

Roberto Barbieri Carrera <sebulain>
Thu 21 May 2015 01:57:35 PM UTC, comment #2: 

Yes, but len could be three things:

diff = conn->current_msg->msg.w.len - conn->write_offset;

or

len = 0xffff;

or

len = available;   The space available in snd_buf

So if conn->write_offset is not zero at the beginning, the expression

(len < conn->current_msg->msg.w.len)

doesn't have the meaning one expects.

The expression

(conn->write_offset + len)

looks correct to me.

But may be I'm wrong, I just wanted to report this junst in case.

Kind regards, and thanks for your fast answer,
Roberto Barbieri Carrera
Archwave AG





Roberto Barbieri Carrera <sebulain>
Thu 21 May 2015 01:50:13 PM UTC, comment #1: 

The idea behind this line is that a non-blocking write should never block, so it will call "do_writemore" only once. That in turn means that write_offset will always be zero.

Simon Goldschmidt <goldsimon>
Group administrator
Thu 21 May 2015 09:23:53 AM UTC, original submission:  

Hello

Trying to solve some problems that I'm having with TCP retransmissions (still not clear enough to report), I run into the following piece of code.

File api_msg.c, function do_writemore(), line 1274:
      if (dontblock && (len < conn->current_msg->msg.w.len)) {

I have the feeling this should be:
      if (dontblock && ((conn->write_offset + len) < conn->current_msg->msg.w.len)) {

I don't think this is the source of my problems, but I wanted to report this so that the people that know more about the code can check it.

Thanks for lwIP, and kind regards,
Roberto Barbieri Carrera
Archwave AG

Roberto Barbieri Carrera <sebulain>

 

(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 sebulain (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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-05-21 goldsimon StatusNone Invalid
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code