On Mon, Jul 5, 2010 at 6:52 PM, Ofer Heifetz <oferh@marvell.com> wrote:
I checked the function: sys_recvfile() and found It is buggy.
to_write = nread;
while (to_write > 0) {
int thistime;
thistime = splice(pipefd[0], NULL, tofd,
&splice_offset, to_write,
SPLICE_F_MOVE);
if (thistime == -1) {
goto done;
}
to_write -= thistime;
}
total_written += nread;
count -= nread;
When splice fails, it should drain the pipe. If not, the following
splice(2) to pipe may hang, because the pipe hasn't enough space for
the data read from socket.
No. I means to read all the data in the pipe.
--
Regards,
Changli Gao(xiaosuo@gmail.com)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html