On Wed, Dec 04, 2013 at 04:37:51PM +0800, Godbach wrote:
> Please check the attachment for patch 0001.
OK first patch applied, thanks.
> >So it should also be simplified this way :
> >
> > si_conn_send(si->conn);
> > if (si->conn->flags & CO_FL_ERROR) {
> > /* Write error on the file descriptor */
> > fd_stop_both(si->conn->t.sock.fd);
> > __conn_data_stop_both(si->conn);
> > si->flags |= SI_FL_ERR;
> > goto out_wakeup;
> > }
> >
>
> Thank you for pointing this. Yes, both stream_int_chk_snd_conn() and
> si_conn_send_cb() will call si_conn_send(), and the code
> si->conn->flags |= CO_FL_ERROR;
> in stream_int_chk_snd_conn() as you listed above can be removed too.
>
> >I accept the change provided that you change the comments on top
> >of si_conn_send() to clearly state that the caller should check
> >conn->flags for errors.
>
> It seems that the return value of si_conn_send() will not be used
> anymore. Furthermore, si_conn_send_cb() does not need to check
> conn->flags for errors since it will return directly after calling
> si_conn_send().
Sorry for not being clear about this in the first mail but I mean we
should have si_conn_send() return void so that the caller only checks
ther flags, hence the removal of the comment above.
Willy