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?

Submitted by:  Roberto Barbieri Carrera <sebulain>
Submitted on:  Thu 21 May 2015 09:23:53 AM UTC  
 
Category: TCPSeverity: 3 - Normal
Item Group: NoneStatus: Invalid
Privacy: PublicAssigned to: None
Open/Closed: ClosedPlanned 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>
Project 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>
Project 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>

 

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

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 21 May 2015 01:50:13 PM UTCgoldsimonStatusNone=>Invalid
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1