In h1_shutw() and h1_shutr(), don't attempt to shutdown() the connection
if we're using keepalive and the connection has no error, or we will close
the connection too soon.
if (!h1s)
return;
- if ((h1s->flags & H1S_F_WANT_KAL) && !(cs->flags & (CS_FL_REOS|CS_FL_EOS)))
+ if ((h1s->flags & H1S_F_WANT_KAL) &&
+ !(cs->conn->flags & (CO_FL_ERROR | CO_FL_SOCK_RD_SH | CO_FL_SOCK_WR_SH)))
return;
/* NOTE: Be sure to handle abort (cf. h2_shutr) */
h1c = h1s->h1c;
if ((h1s->flags & H1S_F_WANT_KAL) &&
- !(cs->flags & (CS_FL_REOS|CS_FL_EOS)) &&
+ !(h1c->conn->flags & (CO_FL_ERROR | CO_FL_SOCK_RD_SH | CO_FL_SOCK_WR_SH)) &&
+
h1s->req.state == H1_MSG_DONE && h1s->res.state == H1_MSG_DONE)
return;