[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <488F1844.1070005@bellsouth.net>
Date: Tue, 29 Jul 2008 08:16:52 -0500
From: "J. K. Cliburn" <jcliburn@...il.com>
To: Jarek Poplawski <jarkao2@...il.com>
CC: netdev@...r.kernel.org, ian@...fray.co.uk
Subject: Re: sendfile() behavior while troubleshooting netdevice
Hi Jarek,
Jarek Poplawski wrote:
> sfclient.c:
> ...
> prev = count;
> count += ret;
> if (prev == count) {
> fprintf(stderr, "error: expected %d, received %d\n",
> fsize, count);
> ---> exit(1);
> }
>
> Maybe you could try without this exit if anything comes later?
That's the way I initially had it, but I'd get infinite loops when the
bytes were lost; no additional bytes ever showed up. The 'if (prev ==
count)' check was added later, just to kick the thing out of that
infinite loop.
However, your question made me realize that ret can be -1, and I don't
want to change 'count' in that case. Changed to
if (ret > 0)
count += ret;
Thanks,
Jay
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists