Hi Willy,

It seems that the loop will be only excuted once.

The related codes as below(src/stream_interface.c):
> static int si_conn_send_loop(struct connection *conn)
> {
> ...
> while (!(conn->flags & (CO_FL_ERROR | CO_FL_SOCK_WR_SH | ...))) {
> ...
> ret = conn->xprt->snd_buf(conn, chn->buf, send_flag);
> if (ret <= 0)
> break;
>
> chn->flags |= CF_WRITE_PARTIAL;
>
> if (!chn->buf->o) {
> ...
> }
>
> /* if some data remain in the buffer, it's only because the
> * system bufers are full, so we don't want to loop again.
> */
> break;
> } /* while */
>
> if (conn->flags & CO_FL_ERROR)
> return -1;
>
> return 0;
> }
Since there is a 'break' with no condition in the last line of while
loop, the loop will
be only excuted once. It just looks like a 'if' as below:
> - while (!(conn->flags & (CO_FL_ERROR | CO_FL_SOCK_WR_SH | ...))) {
> + if (!(conn->flags & (CO_FL_ERROR | CO_FL_SOCK_WR_SH | ...))) {

-- 
Best Regards,
Godbach


Reply via email to