[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-members] TCP question about tcp_output.c/tcp_enqueue()
From: |
Adam Dunkels |
Subject: |
Re: [lwip-members] TCP question about tcp_output.c/tcp_enqueue() |
Date: |
08 Jan 2003 15:04:02 +0100 |
Hi!
On Wed, 2003-01-08 at 11:37, Kieran Mansley wrote:
> > Can someone explain to me what the "while (queue == NULL" does in
> >
> > tcp_output.c/tcp_enqueue()
> > {
> > ...
> > while(queue == NULL || left > 0) {
> > ...
>
> Looks to me like it's doing nothing, as queue will always be non-NULL by
> the end of the loop. It does ensure the loop gets executed if left = 0
> before the loop though (because queue is always NULL before the loop).
> ie. It makes it equivalent to:
>
> do{
> ...
> }while(left > 0);
>
> but I'm not sure if that is intended or just a side effect.
Yes, the intention is just what you describe. Perhaps it should be
changed to a do{}while() loop instead, just to make it clearer?
/adam
--
Adam Dunkels <address@hidden>
http://www.sics.se/~adam/