int timeout; /* idle timeout duration in ticks */
int shut_timeout; /* idle timeout duration in ticks after GOAWAY was sent */
- int idle_start; /* date of the last time the connection went idle */
+ int idle_start; /* date of the last time the connection went idle (no stream + empty mbuf), or the start of current http req */
/* 32-bit hole here */
unsigned int nb_streams; /* number of streams in the tree */
unsigned int nb_sc; /* number of attached stream connectors */
}
/* transition to HEADERS frame ends the keep-alive idle
- * timer and starts the http-request idle delay.
+ * timer and starts the http-request idle delay. It uses
+ * the idle_start timer as well.
*/
if (hdr.ft == H2_FT_HEADERS)
h2c->idle_start = now_ms;
if (h2c->flags & H2_CF_RCVD_SHUT)
h2c->flags |= H2_CF_ERROR;
b_reset(br_tail(h2c->mbuf));
+ h2c->idle_start = now_ms;
return 1;
}
/* We're done, no more to send */
if (!(conn->flags & CO_FL_WAIT_XPRT) && !br_data(h2c->mbuf)) {
TRACE_DEVEL("leaving with everything sent", H2_EV_H2C_SEND, h2c->conn);
+ if (!h2c->nb_sc)
+ h2c->idle_start = now_ms;
goto end;
}
sess = h2s->sess;
h2c = h2s->h2c;
h2c->nb_sc--;
- if (!h2c->nb_sc)
+ if (!h2c->nb_sc && !br_data(h2c->mbuf))
h2c->idle_start = now_ms;
if ((h2c->flags & (H2_CF_IS_BACK|H2_CF_DEM_TOOMANY)) == H2_CF_DEM_TOOMANY &&