MINOR: connection: perform the call to xprt->shutw() in conn_data_shutw()

This will save callers from having to care about conn->xprt and xprt->shutw.
Note that shutw() takes a second argument indicating whether it's a clean or
a hard shutw. This is used by SSL which tries to close cleanly in most cases.

Here we provide two versions, conn_data_shutw() which performs the clean
close, and conn_data_shutw_hard() which does the unclean one.
This commit is contained in:
Willy Tarreau 2015-03-12 22:51:10 +01:00
parent 4dfd54f26a
commit 729c69f6e5

View File

@ -420,6 +420,20 @@ static inline void conn_data_shutw(struct connection *c)
{
c->flags |= CO_FL_DATA_WR_SH;
__conn_data_stop_send(c);
/* clean data-layer shutdown */
if (c->xprt && c->xprt->shutw)
c->xprt->shutw(c, 1);
}
static inline void conn_data_shutw_hard(struct connection *c)
{
c->flags |= CO_FL_DATA_WR_SH;
__conn_data_stop_send(c);
/* unclean data-layer shutdown */
if (c->xprt && c->xprt->shutw)
c->xprt->shutw(c, 0);
}
/* detect sock->data read0 transition */