}
}
+/* returns the stconn associated to the H2 stream */
+static forceinline struct stconn *h2s_sc(const struct h2s *h2s)
+{
+ return h2s->endp->cs;
+}
+
/* the H2 traces always expect that arg1, if non-null, is of type connection
* (from which we can derive h2c), that arg2, if non-null, is of type h2s, and
* that arg3, if non-null, is either of type htx for tx headers, or of type
}
if ((h2c->flags & H2_CF_DEM_SALLOC) &&
- (h2s = h2c_st_by_id(h2c, h2c->dsi)) && h2s->endp->cs &&
+ (h2s = h2c_st_by_id(h2c, h2c->dsi)) && h2s_sc(h2s) &&
b_alloc(&h2s->rxbuf)) {
h2c->flags &= ~H2_CF_DEM_SALLOC;
h2c_restart_reading(h2c, 1);
h2s_notify_recv(h2s);
h2s_notify_send(h2s);
}
- else if (h2s->endp->cs && h2s->endp->cs->data_cb->wake != NULL) {
+ else if (h2s_sc(h2s) && h2s_sc(h2s)->data_cb->wake != NULL) {
TRACE_POINT(H2_EV_STRM_WAKE, h2s->h2c->conn, h2s);
- h2s->endp->cs->data_cb->wake(h2s->endp->cs);
+ h2s_sc(h2s)->data_cb->wake(h2s_sc(h2s));
}
TRACE_LEAVE(H2_EV_H2S_WAKE, h2s->h2c->conn, h2s);
h2s->h2c->nb_streams--;
if (!h2s->id)
h2s->h2c->nb_reserved--;
- if (h2s->endp->cs) {
+ if (h2s_sc(h2s)) {
if (!se_fl_test(h2s->endp, SE_FL_EOS) && !b_data(&h2s->rxbuf))
h2s_notify_recv(h2s);
}
TRACE_ENTER(H2_EV_H2S_WAKE, h2c->conn, h2s);
- if (!h2s->endp->cs) {
+ if (!h2s_sc(h2s)) {
/* this stream was already orphaned */
h2s_destroy(h2s);
TRACE_DEVEL("leaving with no h2s", H2_EV_H2S_WAKE, h2c->conn);
h2s->errcode = h2_get_n32(&h2c->dbuf, 0);
h2s_close(h2s);
- if (h2s->endp->cs) {
+ if (h2s_sc(h2s)) {
cs_ep_set_error(h2s->endp);
h2s_alert(h2s);
}
/* call the upper layers to process the frame, then let the upper layer
* notify the stream about any change.
*/
- if (!h2s->endp->cs) {
+ if (!h2s_sc(h2s)) {
/* The upper layer has already closed, this may happen on
* 4xx/redirects during POST, or when receiving a response
* from an H2 server after the client has aborted.
*/
tmp_h2s = h2c_st_by_id(h2c, h2c->dsi);
- if (tmp_h2s != h2s && h2s && h2s->endp->cs &&
+ if (tmp_h2s != h2s && h2s && h2s_sc(h2s) &&
(b_data(&h2s->rxbuf) ||
h2c_read0_pending(h2c) ||
h2s->st == H2_SS_CLOSED ||
h2c->flags |= H2_CF_END_REACHED;
}
- if (h2s && h2s->endp->cs &&
+ if (h2s && h2s_sc(h2s) &&
(b_data(&h2s->rxbuf) ||
h2c_read0_pending(h2c) ||
h2s->st == H2_SS_CLOSED ||
node = eb32_first(&h2c->streams_by_id);
while (node) {
h2s = container_of(node, struct h2s, by_id);
- if (h2s->endp->cs)
- return h2s->endp->cs;
+ if (h2s_sc(h2s))
+ return h2s_sc(h2s);
node = eb32_next(node);
}
return NULL;
/* We're done trying to send, remove ourself from the send_list */
LIST_DEL_INIT(&h2s->list);
- if (!h2s->endp->cs) {
+ if (!h2s_sc(h2s)) {
h2s_destroy(h2s);
if (h2c_is_dead(h2c)) {
h2_release(h2c);
break;
}
- if (!h2s->endp->cs || se_fl_test(h2s->endp, SE_FL_SHW)) {
+ if (!h2s_sc(h2s) || se_fl_test(h2s->endp, SE_FL_SHW)) {
/* Response already closed: add END_STREAM */
es_now = 1;
}
break;
}
- if (!h2s->endp->cs || se_fl_test(h2s->endp, SE_FL_SHW)) {
+ if (!h2s_sc(h2s) || se_fl_test(h2s->endp, SE_FL_SHW)) {
/* Request already closed: add END_STREAM */
es_now = 1;
}
while (node) {
h2s = container_of(node, struct h2s, by_id);
tree_cnt++;
- if (!h2s->endp->cs)
+ if (!h2s_sc(h2s))
orph_cnt++;
node = eb32_next(node);
}
h2s, h2s->id, h2s_st_to_str(h2s->st), h2s->flags,
(unsigned int)b_data(&h2s->rxbuf), b_orig(&h2s->rxbuf),
(unsigned int)b_head_ofs(&h2s->rxbuf), (unsigned int)b_size(&h2s->rxbuf),
- h2s->endp->cs);
- if (h2s->endp->cs)
+ h2s_sc(h2s));
+ if (h2s_sc(h2s))
chunk_appendf(msg, "(.flg=0x%08x .app=%p)",
- h2s->endp->cs->flags, h2s->endp->cs->app);
+ h2s_sc(h2s)->flags, h2s_sc(h2s)->app);
chunk_appendf(msg, "endp=%p", h2s->endp);
if (h2s->endp)