cs_conn_shutr(cs, CO_SHR_DRAIN);
}
-/* sets CS_EP_ERROR or CS_EP_ERR_PENDING on the cs */
-static inline void cs_set_error(struct conn_stream *cs)
+/* sets CS_EP_ERROR or CS_EP_ERR_PENDING on the endpoint */
+static inline void cs_ep_set_error(struct cs_endpoint *endp)
{
- if (cs->endp->flags & CS_EP_EOS)
- cs->endp->flags |= CS_EP_ERROR;
+ if (endp->flags & CS_EP_EOS)
+ endp->flags |= CS_EP_ERROR;
else
- cs->endp->flags |= CS_EP_ERR_PENDING;
+ endp->flags |= CS_EP_ERR_PENDING;
}
/* Retrieves any valid conn_stream from this connection, preferably the first
TRACE_STATE("switching to ERROR", FCGI_EV_FSTRM_ERR, fstrm->fconn->conn, fstrm);
}
if (fstrm->cs)
- cs_set_error(fstrm->cs);
+ cs_ep_set_error(fstrm->cs->endp);
}
}
if (fstrm->state == FCGI_SS_ERROR) {
TRACE_DEVEL("reporting error to the app-layer stream", FCGI_EV_STRM_SEND|FCGI_EV_FSTRM_ERR|FCGI_EV_STRM_ERR, fconn->conn, fstrm);
- cs_set_error(cs);
+ cs_ep_set_error(cs->endp);
if (!(fstrm->flags & FCGI_SF_BEGIN_SENT) || fcgi_strm_send_abort(fconn, fstrm))
fcgi_strm_close(fstrm);
}
if (h2s->st < H2_SS_ERROR)
h2s->st = H2_SS_ERROR;
if (h2s->cs)
- cs_set_error(h2s->cs);
+ cs_ep_set_error(h2s->endp);
}
}
h2s_close(h2s);
if (h2s->cs) {
- cs_set_error(h2s->cs);
+ cs_ep_set_error(h2s->endp);
h2s_alert(h2s);
}
/* RST are sent similarly to frame acks */
if (h2s->st == H2_SS_ERROR || h2s->flags & H2_SF_RST_RCVD) {
TRACE_DEVEL("reporting RST/error to the app-layer stream", H2_EV_H2S_SEND|H2_EV_H2S_ERR|H2_EV_STRM_ERR, h2s->h2c->conn, h2s);
- cs_set_error(cs);
+ cs_ep_set_error(cs->endp);
if (h2s_send_rst_stream(h2s->h2c, h2s) > 0)
h2s_close(h2s);
}