CLEANUP: stconn: rename cs_{i,o}{b,c} to sc_{i,o}{b,c}
We're starting to propagate the stream connector's new name through the
API. Most call places of these functions that retrieve the channel or its
buffer are in applets. The local variable names are not changed in order
to keep the changes small and reviewable. There were ~92 uses of cs_ic(),
~96 of cs_oc() (due to co_get*() being less factorizable than ci_put*),
and ~5 accesses to the buffer itself.
diff --git a/src/activity.c b/src/activity.c
index 1b938a2..5e73ff4 100644
--- a/src/activity.c
+++ b/src/activity.c
@@ -627,7 +627,7 @@
int max_lines;
int i, max;
- if (unlikely(cs_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
+ if (unlikely(sc_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
return 1;
chunk_reset(&trash);
@@ -851,7 +851,7 @@
int thr, queue;
int i, max;
- if (unlikely(cs_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
+ if (unlikely(sc_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
return 1;
/* It's not possible to scan queues in small chunks and yield in the
diff --git a/src/applet.c b/src/applet.c
index 5253739..fe1fc62 100644
--- a/src/applet.c
+++ b/src/applet.c
@@ -173,11 +173,11 @@
cs_rx_buff_rdy(cs);
/* was already allocated another way ? if so, don't take this one */
- if (c_size(cs_ic(cs)) || cs_ic(cs)->pipe)
+ if (c_size(sc_ic(cs)) || sc_ic(cs)->pipe)
return 0;
/* allocation possible now ? */
- if (!b_alloc(&cs_ic(cs)->buf)) {
+ if (!b_alloc(&sc_ic(cs)->buf)) {
cs_rx_buff_blk(cs);
return 0;
}
@@ -230,29 +230,29 @@
if (!cs_alloc_ibuf(cs, &app->buffer_wait))
cs_rx_endp_more(cs);
- count = co_data(cs_oc(cs));
+ count = co_data(sc_oc(cs));
app->applet->fct(app);
/* now check if the applet has released some room and forgot to
* notify the other side about it.
*/
- if (count != co_data(cs_oc(cs))) {
- cs_oc(cs)->flags |= CF_WRITE_PARTIAL | CF_WROTE_DATA;
+ if (count != co_data(sc_oc(cs))) {
+ sc_oc(cs)->flags |= CF_WRITE_PARTIAL | CF_WROTE_DATA;
cs_rx_room_rdy(cs_opposite(cs));
}
/* measure the call rate and check for anomalies when too high */
rate = update_freq_ctr(&app->call_rate, 1);
if (rate >= 100000 && app->call_rate.prev_ctr && // looped more than 100k times over last second
- ((b_size(cs_ib(cs)) && se_fl_test(app->sedesc, SE_FL_RXBLK_BUFF)) || // asks for a buffer which is present
- (b_size(cs_ib(cs)) && !b_data(cs_ib(cs)) && se_fl_test(app->sedesc, SE_FL_RXBLK_ROOM)) || // asks for room in an empty buffer
- (b_data(cs_ob(cs)) && cs_tx_endp_ready(cs) && !cs_tx_blocked(cs)) || // asks for data already present
- (!b_data(cs_ib(cs)) && b_data(cs_ob(cs)) && // didn't return anything ...
- (cs_oc(cs)->flags & (CF_WRITE_PARTIAL|CF_SHUTW_NOW)) == CF_SHUTW_NOW))) { // ... and left data pending after a shut
+ ((b_size(sc_ib(cs)) && se_fl_test(app->sedesc, SE_FL_RXBLK_BUFF)) || // asks for a buffer which is present
+ (b_size(sc_ib(cs)) && !b_data(sc_ib(cs)) && se_fl_test(app->sedesc, SE_FL_RXBLK_ROOM)) || // asks for room in an empty buffer
+ (b_data(sc_ob(cs)) && cs_tx_endp_ready(cs) && !cs_tx_blocked(cs)) || // asks for data already present
+ (!b_data(sc_ib(cs)) && b_data(sc_ob(cs)) && // didn't return anything ...
+ (sc_oc(cs)->flags & (CF_WRITE_PARTIAL|CF_SHUTW_NOW)) == CF_SHUTW_NOW))) { // ... and left data pending after a shut
stream_dump_and_crash(&app->obj_type, read_freq_ctr(&app->call_rate));
}
cs->app_ops->wake(cs);
- channel_release_buffer(cs_ic(cs), &app->buffer_wait);
+ channel_release_buffer(sc_ic(cs), &app->buffer_wait);
return t;
}
diff --git a/src/backend.c b/src/backend.c
index b1c33f6..83b3bf1 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -1802,7 +1802,7 @@
*/
((cli_conn->flags & CO_FL_EARLY_DATA) ||
((s->be->retry_type & PR_RE_EARLY_ERROR) && !s->conn_retries)) &&
- !channel_is_empty(cs_oc(s->scb)) &&
+ !channel_is_empty(sc_oc(s->scb)) &&
srv_conn->flags & CO_FL_SSL_WAIT_HS)
srv_conn->flags &= ~(CO_FL_SSL_WAIT_HS | CO_FL_WAIT_L6_CONN);
#endif
@@ -1839,7 +1839,7 @@
if (!cs_state_in(s->scb->state, SC_SB_EST|SC_SB_DIS|SC_SB_CLO) &&
(srv_conn->flags & CO_FL_WAIT_XPRT) == 0) {
s->conn_exp = TICK_ETERNITY;
- cs_oc(s->scb)->flags |= CF_WRITE_NULL;
+ sc_oc(s->scb)->flags |= CF_WRITE_NULL;
if (s->scb->state == SC_ST_CON)
s->scb->state = SC_ST_RDY;
}
@@ -1851,8 +1851,8 @@
* wake callback. Otherwise si_cs_recv()/si_cs_send() already take
* care of it.
*/
- if (sc_ep_test(s->scb, SE_FL_EOI) && !(cs_ic(s->scb)->flags & CF_EOI))
- cs_ic(s->scb)->flags |= (CF_EOI|CF_READ_PARTIAL);
+ if (sc_ep_test(s->scb, SE_FL_EOI) && !(sc_ic(s->scb)->flags & CF_EOI))
+ sc_ic(s->scb)->flags |= (CF_EOI|CF_READ_PARTIAL);
/* catch all sync connect while the mux is not already installed */
if (!srv_conn->mux && !(srv_conn->flags & CO_FL_WAIT_XPRT)) {
diff --git a/src/cache.c b/src/cache.c
index f28ff89..e90bfb4 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -1294,7 +1294,7 @@
uint32_t blksz;
max = htx_get_max_blksz(htx,
- channel_htx_recv_max(cs_ic(appctx_cs(appctx)), htx));
+ channel_htx_recv_max(sc_ic(appctx_cs(appctx)), htx));
if (!max)
return 0;
blksz = ((type == HTX_BLK_HDR || type == HTX_BLK_TLR)
@@ -1338,7 +1338,7 @@
uint32_t blksz;
max = htx_get_max_blksz(htx,
- channel_htx_recv_max(cs_ic(appctx_cs(appctx)), htx));
+ channel_htx_recv_max(sc_ic(appctx_cs(appctx)), htx));
if (!max)
return 0;
@@ -1456,8 +1456,8 @@
struct cache_entry *cache_ptr = ctx->entry;
struct shared_block *first = block_ptr(cache_ptr);
struct stconn *cs = appctx_cs(appctx);
- struct channel *req = cs_oc(cs);
- struct channel *res = cs_ic(cs);
+ struct channel *req = sc_oc(cs);
+ struct channel *res = sc_ic(cs);
struct htx *req_htx, *res_htx;
struct buffer *errmsg;
unsigned int len;
diff --git a/src/cli.c b/src/cli.c
index 95d487d..d4aaa62 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -898,8 +898,8 @@
static void cli_io_handler(struct appctx *appctx)
{
struct stconn *cs = appctx_cs(appctx);
- struct channel *req = cs_oc(cs);
- struct channel *res = cs_ic(cs);
+ struct channel *req = sc_oc(cs);
+ struct channel *res = sc_ic(cs);
struct bind_conf *bind_conf = strm_li(__cs_strm(cs))->bind_conf;
int reql;
int len;
@@ -950,7 +950,7 @@
/* ensure we have some output room left in the event we
* would want to return some info right after parsing.
*/
- if (buffer_almost_full(cs_ib(cs))) {
+ if (buffer_almost_full(sc_ib(cs))) {
cs_rx_room_blk(cs);
break;
}
@@ -962,10 +962,10 @@
*/
if (appctx->st1 & APPCTX_CLI_ST1_PAYLOAD)
- reql = co_getline(cs_oc(cs), str,
+ reql = co_getline(sc_oc(cs), str,
appctx->chunk->size - appctx->chunk->data - 1);
else
- reql = co_getdelim(cs_oc(cs), str,
+ reql = co_getdelim(sc_oc(cs), str,
appctx->chunk->size - appctx->chunk->data - 1,
"\n;", '\\');
@@ -1050,7 +1050,7 @@
}
/* re-adjust req buffer */
- co_skip(cs_oc(cs), reql);
+ co_skip(sc_oc(cs), reql);
req->flags |= CF_READ_DONTWAIT; /* we plan to read small requests */
}
else { /* output functions */
@@ -1161,7 +1161,7 @@
* refills the buffer with new bytes in non-interactive
* mode, avoiding to close on apparently empty commands.
*/
- if (co_data(cs_oc(cs))) {
+ if (co_data(sc_oc(cs))) {
appctx_wakeup(appctx);
goto out;
}
@@ -1227,7 +1227,7 @@
struct stconn *cs = appctx_cs(appctx);
char **var = ctx->var;
- if (unlikely(cs_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
+ if (unlikely(sc_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
return 1;
chunk_reset(&trash);
@@ -1264,7 +1264,7 @@
int fd = fdctx->fd;
int ret = 1;
- if (unlikely(cs_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
+ if (unlikely(sc_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
goto end;
chunk_reset(&trash);
@@ -1461,7 +1461,7 @@
struct stconn *cs = appctx_cs(appctx);
int thr;
- if (unlikely(cs_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
+ if (unlikely(sc_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
return 1;
chunk_reset(&trash);
@@ -2169,7 +2169,7 @@
void pcli_write_prompt(struct stream *s)
{
struct buffer *msg = get_trash_chunk();
- struct channel *oc = cs_oc(s->scf);
+ struct channel *oc = sc_oc(s->scf);
if (!(s->pcli_flags & PCLI_F_PROMPT))
return;
diff --git a/src/conn_stream.c b/src/conn_stream.c
index ffb2b79..e15ba4d 100644
--- a/src/conn_stream.c
+++ b/src/conn_stream.c
@@ -505,7 +505,7 @@
*/
static void sc_app_shutr(struct stconn *cs)
{
- struct channel *ic = cs_ic(cs);
+ struct channel *ic = sc_ic(cs);
cs_rx_shut_blk(cs);
if (ic->flags & CF_SHUTR)
@@ -516,7 +516,7 @@
if (!cs_state_in(cs->state, SC_SB_CON|SC_SB_RDY|SC_SB_EST))
return;
- if (cs_oc(cs)->flags & CF_SHUTW) {
+ if (sc_oc(cs)->flags & CF_SHUTW) {
cs->state = SC_ST_DIS;
__cs_strm(cs)->conn_exp = TICK_ETERNITY;
}
@@ -539,8 +539,8 @@
*/
static void sc_app_shutw(struct stconn *cs)
{
- struct channel *ic = cs_ic(cs);
- struct channel *oc = cs_oc(cs);
+ struct channel *ic = sc_ic(cs);
+ struct channel *oc = sc_oc(cs);
oc->flags &= ~CF_SHUTW_NOW;
if (oc->flags & CF_SHUTW)
@@ -591,11 +591,11 @@
/* default chk_rcv function for scheduled tasks */
static void sc_app_chk_rcv(struct stconn *cs)
{
- struct channel *ic = cs_ic(cs);
+ struct channel *ic = sc_ic(cs);
DPRINTF(stderr, "%s: cs=%p, cs->state=%d ic->flags=%08x oc->flags=%08x\n",
__FUNCTION__,
- cs, cs->state, ic->flags, cs_oc(cs)->flags);
+ cs, cs->state, ic->flags, sc_oc(cs)->flags);
if (ic->pipe) {
/* stop reading */
@@ -611,11 +611,11 @@
/* default chk_snd function for scheduled tasks */
static void sc_app_chk_snd(struct stconn *cs)
{
- struct channel *oc = cs_oc(cs);
+ struct channel *oc = sc_oc(cs);
DPRINTF(stderr, "%s: cs=%p, cs->state=%d ic->flags=%08x oc->flags=%08x\n",
__FUNCTION__,
- cs, cs->state, cs_ic(cs)->flags, oc->flags);
+ cs, cs->state, sc_ic(cs)->flags, oc->flags);
if (unlikely(cs->state != SC_ST_EST || (oc->flags & CF_SHUTW)))
return;
@@ -647,7 +647,7 @@
*/
static void sc_app_shutr_conn(struct stconn *cs)
{
- struct channel *ic = cs_ic(cs);
+ struct channel *ic = sc_ic(cs);
BUG_ON(!cs_conn(cs));
@@ -660,7 +660,7 @@
if (!cs_state_in(cs->state, SC_SB_CON|SC_SB_RDY|SC_SB_EST))
return;
- if (cs_oc(cs)->flags & CF_SHUTW) {
+ if (sc_oc(cs)->flags & CF_SHUTW) {
cs_conn_shut(cs);
cs->state = SC_ST_DIS;
__cs_strm(cs)->conn_exp = TICK_ETERNITY;
@@ -681,8 +681,8 @@
*/
static void sc_app_shutw_conn(struct stconn *cs)
{
- struct channel *ic = cs_ic(cs);
- struct channel *oc = cs_oc(cs);
+ struct channel *ic = sc_ic(cs);
+ struct channel *oc = sc_oc(cs);
BUG_ON(!cs_conn(cs));
@@ -776,7 +776,7 @@
*/
static void sc_app_chk_snd_conn(struct stconn *cs)
{
- struct channel *oc = cs_oc(cs);
+ struct channel *oc = sc_oc(cs);
BUG_ON(!cs_conn(cs));
@@ -791,7 +791,7 @@
!sc_ep_test(cs, SE_FL_WAIT_DATA)) /* not waiting for data */
return;
- if (!(cs->wait_event.events & SUB_RETRY_SEND) && !channel_is_empty(cs_oc(cs)))
+ if (!(cs->wait_event.events & SUB_RETRY_SEND) && !channel_is_empty(sc_oc(cs)))
cs_conn_send(cs);
if (sc_ep_test(cs, SE_FL_ERROR | SE_FL_ERR_PENDING) || cs_is_conn_error(cs)) {
@@ -831,7 +831,7 @@
}
if (likely(oc->flags & CF_WRITE_ACTIVITY)) {
- struct channel *ic = cs_ic(cs);
+ struct channel *ic = sc_ic(cs);
/* update timeout if we have written something */
if ((oc->flags & (CF_SHUTW|CF_WRITE_PARTIAL)) == CF_WRITE_PARTIAL &&
@@ -874,7 +874,7 @@
*/
static void sc_app_shutr_applet(struct stconn *cs)
{
- struct channel *ic = cs_ic(cs);
+ struct channel *ic = sc_ic(cs);
BUG_ON(!cs_appctx(cs));
@@ -889,7 +889,7 @@
if (!cs_state_in(cs->state, SC_SB_CON|SC_SB_RDY|SC_SB_EST))
return;
- if (cs_oc(cs)->flags & CF_SHUTW) {
+ if (sc_oc(cs)->flags & CF_SHUTW) {
appctx_shut(__cs_appctx(cs));
cs->state = SC_ST_DIS;
__cs_strm(cs)->conn_exp = TICK_ETERNITY;
@@ -909,8 +909,8 @@
*/
static void sc_app_shutw_applet(struct stconn *cs)
{
- struct channel *ic = cs_ic(cs);
- struct channel *oc = cs_oc(cs);
+ struct channel *ic = sc_ic(cs);
+ struct channel *oc = sc_oc(cs);
BUG_ON(!cs_appctx(cs));
@@ -963,13 +963,13 @@
/* chk_rcv function for applets */
static void sc_app_chk_rcv_applet(struct stconn *cs)
{
- struct channel *ic = cs_ic(cs);
+ struct channel *ic = sc_ic(cs);
BUG_ON(!cs_appctx(cs));
DPRINTF(stderr, "%s: cs=%p, cs->state=%d ic->flags=%08x oc->flags=%08x\n",
__FUNCTION__,
- cs, cs->state, ic->flags, cs_oc(cs)->flags);
+ cs, cs->state, ic->flags, sc_oc(cs)->flags);
if (!ic->pipe) {
/* (re)start reading */
@@ -980,13 +980,13 @@
/* chk_snd function for applets */
static void sc_app_chk_snd_applet(struct stconn *cs)
{
- struct channel *oc = cs_oc(cs);
+ struct channel *oc = sc_oc(cs);
BUG_ON(!cs_appctx(cs));
DPRINTF(stderr, "%s: cs=%p, cs->state=%d ic->flags=%08x oc->flags=%08x\n",
__FUNCTION__,
- cs, cs->state, cs_ic(cs)->flags, oc->flags);
+ cs, cs->state, sc_ic(cs)->flags, oc->flags);
if (unlikely(cs->state != SC_ST_EST || (oc->flags & CF_SHUTW)))
return;
@@ -1017,7 +1017,7 @@
*/
void cs_update_rx(struct stconn *cs)
{
- struct channel *ic = cs_ic(cs);
+ struct channel *ic = sc_ic(cs);
if (ic->flags & CF_SHUTR) {
cs_rx_shut_blk(cs);
@@ -1061,8 +1061,8 @@
*/
void cs_update_tx(struct stconn *cs)
{
- struct channel *oc = cs_oc(cs);
- struct channel *ic = cs_ic(cs);
+ struct channel *oc = sc_oc(cs);
+ struct channel *ic = sc_ic(cs);
if (oc->flags & CF_SHUTW)
return;
@@ -1110,8 +1110,8 @@
*/
static void cs_notify(struct stconn *cs)
{
- struct channel *ic = cs_ic(cs);
- struct channel *oc = cs_oc(cs);
+ struct channel *ic = sc_ic(cs);
+ struct channel *oc = sc_oc(cs);
struct stconn *cso = cs_opposite(cs);
struct task *task = cs_strm_task(cs);
@@ -1239,8 +1239,8 @@
*/
static void cs_conn_read0(struct stconn *cs)
{
- struct channel *ic = cs_ic(cs);
- struct channel *oc = cs_oc(cs);
+ struct channel *ic = sc_ic(cs);
+ struct channel *oc = sc_oc(cs);
BUG_ON(!cs_conn(cs));
@@ -1289,7 +1289,7 @@
static int cs_conn_recv(struct stconn *cs)
{
struct connection *conn = __cs_conn(cs);
- struct channel *ic = cs_ic(cs);
+ struct channel *ic = sc_ic(cs);
int ret, max, cur_read = 0;
int read_poll = MAX_READ_POLL_LOOPS;
int flags = 0;
@@ -1644,7 +1644,7 @@
{
struct connection *conn = __cs_conn(cs);
struct stream *s = __cs_strm(cs);
- struct channel *oc = cs_oc(cs);
+ struct channel *oc = sc_oc(cs);
int ret;
int did_send = 0;
@@ -1787,7 +1787,7 @@
*/
void cs_conn_sync_send(struct stconn *cs)
{
- struct channel *oc = cs_oc(cs);
+ struct channel *oc = sc_oc(cs);
oc->flags &= ~(CF_WRITE_NULL|CF_WRITE_PARTIAL);
@@ -1815,8 +1815,8 @@
static int cs_conn_process(struct stconn *cs)
{
struct connection *conn = __cs_conn(cs);
- struct channel *ic = cs_ic(cs);
- struct channel *oc = cs_oc(cs);
+ struct channel *ic = sc_ic(cs);
+ struct channel *oc = sc_oc(cs);
BUG_ON(!conn);
@@ -1908,7 +1908,7 @@
if (!cs_conn(cs))
return t;
- if (!(cs->wait_event.events & SUB_RETRY_SEND) && !channel_is_empty(cs_oc(cs)))
+ if (!(cs->wait_event.events & SUB_RETRY_SEND) && !channel_is_empty(sc_oc(cs)))
ret = cs_conn_send(cs);
if (!(cs->wait_event.events & SUB_RETRY_RECV))
ret |= cs_conn_recv(cs);
@@ -1926,7 +1926,7 @@
*/
static int cs_applet_process(struct stconn *cs)
{
- struct channel *ic = cs_ic(cs);
+ struct channel *ic = sc_ic(cs);
BUG_ON(!cs_appctx(cs));
diff --git a/src/debug.c b/src/debug.c
index 71f6762..53ab159 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -293,7 +293,7 @@
struct stconn *cs = appctx_cs(appctx);
int thr;
- if (unlikely(cs_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
+ if (unlikely(sc_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
return 1;
if (appctx->st0)
@@ -1052,7 +1052,7 @@
int ret = 1;
int i, fd;
- if (unlikely(cs_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
+ if (unlikely(sc_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
goto end;
chunk_reset(&trash);
@@ -1241,7 +1241,7 @@
struct mem_stats *ptr = ctx->start;
int ret = 1;
- if (unlikely(cs_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
+ if (unlikely(sc_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
goto end;
chunk_reset(&trash);
diff --git a/src/dns.c b/src/dns.c
index 3ed6892..422351b 100644
--- a/src/dns.c
+++ b/src/dns.c
@@ -460,11 +460,11 @@
goto close;
/* an error was detected */
- if (unlikely(cs_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
+ if (unlikely(sc_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
goto close;
/* con closed by server side, we will skip data write and drain data from channel */
- if ((cs_oc(cs)->flags & CF_SHUTW)) {
+ if ((sc_oc(cs)->flags & CF_SHUTW)) {
goto read;
}
@@ -528,7 +528,7 @@
BUG_ON(msg_len + ofs + cnt + 1 > b_data(buf));
/* retrieve available room on output channel */
- available_room = channel_recv_max(cs_ic(cs));
+ available_room = channel_recv_max(sc_ic(cs));
/* tx_msg_offset null means we are at the start of a new message */
if (!ds->tx_msg_offset) {
@@ -669,35 +669,35 @@
if (!ds->rx_msg.len) {
/* next message len is not fully available into the channel */
- if (co_data(cs_oc(cs)) < 2)
+ if (co_data(sc_oc(cs)) < 2)
break;
/* retrieve message len */
- co_getblk(cs_oc(cs), (char *)&msg_len, 2, 0);
+ co_getblk(sc_oc(cs), (char *)&msg_len, 2, 0);
/* mark as consumed */
- co_skip(cs_oc(cs), 2);
+ co_skip(sc_oc(cs), 2);
/* store message len */
ds->rx_msg.len = ntohs(msg_len);
}
- if (!co_data(cs_oc(cs))) {
+ if (!co_data(sc_oc(cs))) {
/* we need more data but nothing is available */
break;
}
- if (co_data(cs_oc(cs)) + ds->rx_msg.offset < ds->rx_msg.len) {
+ if (co_data(sc_oc(cs)) + ds->rx_msg.offset < ds->rx_msg.len) {
/* message only partially available */
/* read available data */
- co_getblk(cs_oc(cs), ds->rx_msg.area + ds->rx_msg.offset, co_data(cs_oc(cs)), 0);
+ co_getblk(sc_oc(cs), ds->rx_msg.area + ds->rx_msg.offset, co_data(sc_oc(cs)), 0);
/* update message offset */
- ds->rx_msg.offset += co_data(cs_oc(cs));
+ ds->rx_msg.offset += co_data(sc_oc(cs));
/* consume all pending data from the channel */
- co_skip(cs_oc(cs), co_data(cs_oc(cs)));
+ co_skip(sc_oc(cs), co_data(sc_oc(cs)));
/* we need to wait for more data */
break;
@@ -706,10 +706,10 @@
/* enough data is available into the channel to read the message until the end */
/* read from the channel until the end of the message */
- co_getblk(cs_oc(cs), ds->rx_msg.area + ds->rx_msg.offset, ds->rx_msg.len - ds->rx_msg.offset, 0);
+ co_getblk(sc_oc(cs), ds->rx_msg.area + ds->rx_msg.offset, ds->rx_msg.len - ds->rx_msg.offset, 0);
/* consume all data until the end of the message from the channel */
- co_skip(cs_oc(cs), ds->rx_msg.len - ds->rx_msg.offset);
+ co_skip(sc_oc(cs), ds->rx_msg.len - ds->rx_msg.offset);
/* reset reader offset to 0 for next message reand */
ds->rx_msg.offset = 0;
@@ -755,7 +755,7 @@
if (!LIST_INLIST(&ds->waiter)) {
/* there is no more pending data to read and the con was closed by the server side */
- if (!co_data(cs_oc(cs)) && (cs_oc(cs)->flags & CF_SHUTW)) {
+ if (!co_data(sc_oc(cs)) && (sc_oc(cs)->flags & CF_SHUTW)) {
goto close;
}
}
@@ -766,7 +766,7 @@
close:
cs_shutw(cs);
cs_shutr(cs);
- cs_ic(cs)->flags |= CF_READ_NULL;
+ sc_ic(cs)->flags |= CF_READ_NULL;
}
void dns_queries_flush(struct dns_session *ds)
diff --git a/src/flt_spoe.c b/src/flt_spoe.c
index df416e7..5e64a82 100644
--- a/src/flt_spoe.c
+++ b/src/flt_spoe.c
@@ -1147,7 +1147,7 @@
memcpy(buf, (char *)&netint, 4);
ret = applet_putblk(appctx, buf, framesz+4);
if (ret <= 0) {
- if ((ret == -3 && b_is_null(&cs_ic(cs)->buf)) || ret == -1) {
+ if ((ret == -3 && b_is_null(&sc_ic(cs)->buf)) || ret == -1) {
/* WT: is this still needed for the case ret==-3 ? */
cs_rx_room_blk(cs);
return 1; /* retry */
@@ -1168,14 +1168,14 @@
int ret;
uint32_t netint;
- ret = co_getblk(cs_oc(cs), (char *)&netint, 4, 0);
+ ret = co_getblk(sc_oc(cs), (char *)&netint, 4, 0);
if (ret > 0) {
framesz = ntohl(netint);
if (framesz > SPOE_APPCTX(appctx)->max_frame_size) {
SPOE_APPCTX(appctx)->status_code = SPOE_FRM_ERR_TOO_BIG;
return -1;
}
- ret = co_getblk(cs_oc(cs), buf, framesz, 4);
+ ret = co_getblk(sc_oc(cs), buf, framesz, 4);
}
if (ret <= 0) {
if (ret == 0) {
@@ -1303,7 +1303,7 @@
cs_shutw(cs);
cs_shutr(cs);
- cs_ic(cs)->flags |= CF_READ_NULL;
+ sc_ic(cs)->flags |= CF_READ_NULL;
}
/* Destroy the task attached to this applet */
@@ -1507,7 +1507,7 @@
next:
/* Do not forget to remove processed frame from the output buffer */
if (trash.data)
- co_skip(cs_oc(cs), trash.data);
+ co_skip(sc_oc(cs), trash.data);
SPOE_APPCTX(appctx)->task->expire =
tick_add_ifset(now_ms, agent->timeout.idle);
@@ -1697,7 +1697,7 @@
/* Do not forget to remove processed frame from the output buffer */
if (trash.data)
- co_skip(cs_oc(appctx_cs(appctx)), trash.data);
+ co_skip(sc_oc(appctx_cs(appctx)), trash.data);
end:
return ret;
}
@@ -1932,7 +1932,7 @@
next:
/* Do not forget to remove processed frame from the output buffer */
if (trash.data)
- co_skip(cs_oc(cs), trash.data);
+ co_skip(sc_oc(cs), trash.data);
return 0;
stop:
@@ -2009,7 +2009,7 @@
cs_shutw(cs);
cs_shutr(cs);
- cs_ic(cs)->flags |= CF_READ_NULL;
+ sc_ic(cs)->flags |= CF_READ_NULL;
/* fall through */
case SPOE_APPCTX_ST_END:
diff --git a/src/hlua.c b/src/hlua.c
index 97da931..eb1a062 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -1938,18 +1938,18 @@
if (ctx->die) {
cs_shutw(cs);
cs_shutr(cs);
- cs_ic(cs)->flags |= CF_READ_NULL;
+ sc_ic(cs)->flags |= CF_READ_NULL;
notification_wake(&ctx->wake_on_read);
notification_wake(&ctx->wake_on_write);
stream_shutdown(__cs_strm(cs), SF_ERR_KILLED);
}
/* If we can't write, wakeup the pending write signals. */
- if (channel_output_closed(cs_ic(cs)))
+ if (channel_output_closed(sc_ic(cs)))
notification_wake(&ctx->wake_on_write);
/* If we can't read, wakeup the pending read signals. */
- if (channel_input_closed(cs_oc(cs)))
+ if (channel_input_closed(sc_oc(cs)))
notification_wake(&ctx->wake_on_read);
/* if the connection is not established, inform the stream that we want
@@ -1966,17 +1966,17 @@
ctx->connected = 1;
/* Wake the tasks which wants to write if the buffer have available space. */
- if (channel_may_recv(cs_ic(cs)))
+ if (channel_may_recv(sc_ic(cs)))
notification_wake(&ctx->wake_on_write);
/* Wake the tasks which wants to read if the buffer contains data. */
- if (!channel_is_empty(cs_oc(cs)))
+ if (!channel_is_empty(sc_oc(cs)))
notification_wake(&ctx->wake_on_read);
/* Some data were injected in the buffer, notify the stream
* interface.
*/
- if (!channel_is_empty(cs_ic(cs)))
+ if (!channel_is_empty(sc_ic(cs)))
cs_update(cs);
/* If write notifications are registered, we considers we want
@@ -4487,7 +4487,7 @@
size_t len2;
/* Read the maximum amount of data available. */
- ret = co_getline_nc(cs_oc(cs), &blk1, &len1, &blk2, &len2);
+ ret = co_getline_nc(sc_oc(cs), &blk1, &len1, &blk2, &len2);
/* Data not yet available. return yield. */
if (ret == 0) {
@@ -4510,7 +4510,7 @@
luaL_addlstring(&luactx->b, blk2, len2);
/* Consume input channel output buffer data. */
- co_skip(cs_oc(cs), len1 + len2);
+ co_skip(sc_oc(cs), len1 + len2);
luaL_pushresult(&luactx->b);
return 1;
}
@@ -4542,7 +4542,7 @@
size_t len2;
/* Read the maximum amount of data available. */
- ret = co_getblk_nc(cs_oc(cs), &blk1, &len1, &blk2, &len2);
+ ret = co_getblk_nc(sc_oc(cs), &blk1, &len1, &blk2, &len2);
/* Data not yet available. return yield. */
if (ret == 0) {
@@ -4568,7 +4568,7 @@
*/
luaL_addlstring(&luactx->b, blk1, len1);
luaL_addlstring(&luactx->b, blk2, len2);
- co_skip(cs_oc(cs), len1 + len2);
+ co_skip(sc_oc(cs), len1 + len2);
cs_cant_get(cs);
MAY_LJMP(hlua_yieldk(L, 0, 0, hlua_applet_tcp_recv_yield, TICK_ETERNITY, 0));
@@ -4587,7 +4587,7 @@
len -= len2;
/* Consume input channel output buffer data. */
- co_skip(cs_oc(cs), len1 + len2);
+ co_skip(sc_oc(cs), len1 + len2);
/* If there is no other data available, yield waiting for new data. */
if (len > 0) {
@@ -4642,7 +4642,7 @@
const char *str = MAY_LJMP(luaL_checklstring(L, 2, &len));
int l = MAY_LJMP(luaL_checkinteger(L, 3));
struct stconn *cs = appctx_cs(luactx->appctx);
- struct channel *chn = cs_ic(cs);
+ struct channel *chn = sc_ic(cs);
int max;
/* Get the max amount of data which can write as input in the channel. */
@@ -4969,7 +4969,7 @@
{
struct hlua_appctx *luactx = MAY_LJMP(hlua_checkapplet_http(L, 1));
struct stconn *cs = appctx_cs(luactx->appctx);
- struct channel *req = cs_oc(cs);
+ struct channel *req = sc_oc(cs);
struct htx *htx;
struct htx_blk *blk;
size_t count;
@@ -5064,7 +5064,7 @@
{
struct hlua_appctx *luactx = MAY_LJMP(hlua_checkapplet_http(L, 1));
struct stconn *cs = appctx_cs(luactx->appctx);
- struct channel *req = cs_oc(cs);
+ struct channel *req = sc_oc(cs);
struct htx *htx;
struct htx_blk *blk;
size_t count;
@@ -5173,7 +5173,7 @@
{
struct hlua_appctx *luactx = MAY_LJMP(hlua_checkapplet_http(L, 1));
struct stconn *cs = appctx_cs(luactx->appctx);
- struct channel *res = cs_ic(cs);
+ struct channel *res = sc_ic(cs);
struct htx *htx = htx_from_buf(&res->buf);
const char *data;
size_t len;
@@ -5310,7 +5310,7 @@
struct hlua_appctx *luactx = MAY_LJMP(hlua_checkapplet_http(L, 1));
struct hlua_http_ctx *http_ctx = luactx->appctx->svcctx;
struct stconn *cs = appctx_cs(luactx->appctx);
- struct channel *res = cs_ic(cs);
+ struct channel *res = sc_ic(cs);
struct htx *htx;
struct htx_sl *sl;
struct h1m h1m;
@@ -5507,7 +5507,7 @@
{
struct hlua_appctx *luactx = MAY_LJMP(hlua_checkapplet_http(L, 1));
struct stconn *cs = appctx_cs(luactx->appctx);
- struct channel *res = cs_ic(cs);
+ struct channel *res = sc_ic(cs);
if (co_data(res)) {
cs_rx_room_blk(cs);
@@ -9316,7 +9316,7 @@
struct hlua_tcp_ctx *tcp_ctx = ctx->svcctx;
struct stconn *cs = appctx_cs(ctx);
struct stream *strm = __cs_strm(cs);
- struct channel *res = cs_ic(cs);
+ struct channel *res = sc_ic(cs);
struct act_rule *rule = ctx->rule;
struct proxy *px = strm->be;
struct hlua *hlua = tcp_ctx->hlua;
@@ -9324,7 +9324,7 @@
/* The applet execution is already done. */
if (tcp_ctx->flags & APPLET_DONE) {
/* eat the whole request */
- co_skip(cs_oc(cs), co_data(cs_oc(cs)));
+ co_skip(sc_oc(cs), co_data(sc_oc(cs)));
return;
}
@@ -9339,7 +9339,7 @@
tcp_ctx->flags |= APPLET_DONE;
/* eat the whole request */
- co_skip(cs_oc(cs), co_data(cs_oc(cs)));
+ co_skip(sc_oc(cs), co_data(sc_oc(cs)));
res->flags |= CF_READ_NULL;
cs_shutr(cs);
return;
@@ -9512,8 +9512,8 @@
struct hlua_http_ctx *http_ctx = ctx->svcctx;
struct stconn *cs = appctx_cs(ctx);
struct stream *strm = __cs_strm(cs);
- struct channel *req = cs_oc(cs);
- struct channel *res = cs_ic(cs);
+ struct channel *req = sc_oc(cs);
+ struct channel *res = sc_ic(cs);
struct act_rule *rule = ctx->rule;
struct proxy *px = strm->be;
struct hlua *hlua = http_ctx->hlua;
diff --git a/src/http_client.c b/src/http_client.c
index 3b76e36..4fb41ac 100644
--- a/src/http_client.c
+++ b/src/http_client.c
@@ -227,8 +227,8 @@
if (ctx->flags & HC_CLI_F_RES_BODY) {
int ret;
- ret = httpclient_res_xfer(hc, cs_ib(cs));
- channel_add_input(cs_ic(cs), ret); /* forward what we put in the buffer channel */
+ ret = httpclient_res_xfer(hc, sc_ib(cs));
+ channel_add_input(sc_ic(cs), ret); /* forward what we put in the buffer channel */
if (!httpclient_data(hc)) {/* remove the flag if the buffer was emptied */
ctx->flags &= ~HC_CLI_F_RES_BODY;
diff --git a/src/log.c b/src/log.c
index 330deb8..a767f59 100644
--- a/src/log.c
+++ b/src/log.c
@@ -3572,14 +3572,14 @@
size_t size;
max_accept = l->maxaccept ? l->maxaccept : 1;
- while (co_data(cs_oc(cs))) {
+ while (co_data(sc_oc(cs))) {
char c;
if (max_accept <= 0)
goto missing_budget;
max_accept--;
- to_skip = co_getchar(cs_oc(cs), &c);
+ to_skip = co_getchar(sc_oc(cs), &c);
if (!to_skip)
goto missing_data;
else if (to_skip < 0)
@@ -3589,7 +3589,7 @@
/* rfc-6587, Non-Transparent-Framing: messages separated by
* a trailing LF or CR LF
*/
- to_skip = co_getline(cs_oc(cs), buf->area, buf->size);
+ to_skip = co_getline(sc_oc(cs), buf->area, buf->size);
if (!to_skip)
goto missing_data;
else if (to_skip < 0)
@@ -3613,7 +3613,7 @@
char *p = NULL;
int msglen;
- to_skip = co_getword(cs_oc(cs), buf->area, buf->size, ' ');
+ to_skip = co_getword(sc_oc(cs), buf->area, buf->size, ' ');
if (!to_skip)
goto missing_data;
else if (to_skip < 0)
@@ -3630,7 +3630,7 @@
if (msglen > buf->size)
goto parse_error;
- msglen = co_getblk(cs_oc(cs), buf->area, msglen, to_skip);
+ msglen = co_getblk(sc_oc(cs), buf->area, msglen, to_skip);
if (!msglen)
goto missing_data;
else if (msglen < 0)
@@ -3643,7 +3643,7 @@
else
goto parse_error;
- co_skip(cs_oc(cs), to_skip);
+ co_skip(sc_oc(cs), to_skip);
/* update counters */
_HA_ATOMIC_INC(&cum_log_messages);
@@ -3657,7 +3657,7 @@
missing_data:
/* we need more data to read */
- cs_oc(cs)->flags |= CF_READ_DONTWAIT;
+ sc_oc(cs)->flags |= CF_READ_DONTWAIT;
return;
@@ -3683,7 +3683,7 @@
cs_shutw(cs);
cs_shutr(cs);
- cs_ic(cs)->flags |= CF_READ_NULL;
+ sc_ic(cs)->flags |= CF_READ_NULL;
return;
}
diff --git a/src/map.c b/src/map.c
index 00185ce..b139710 100644
--- a/src/map.c
+++ b/src/map.c
@@ -348,7 +348,7 @@
struct stconn *cs = appctx_cs(appctx);
struct pat_ref_elt *elt;
- if (unlikely(cs_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW))) {
+ if (unlikely(sc_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW))) {
/* If we're forced to shut down, we might have to remove our
* reference to the last ref_elt being dumped.
*/
diff --git a/src/mworker.c b/src/mworker.c
index 7f0f711..95a2265 100644
--- a/src/mworker.c
+++ b/src/mworker.c
@@ -516,7 +516,7 @@
char *uptime = NULL;
char *reloadtxt = NULL;
- if (unlikely(cs_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
+ if (unlikely(sc_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
return 1;
chunk_reset(&trash);
diff --git a/src/peers.c b/src/peers.c
index c93faf3..a4270c7 100644
--- a/src/peers.c
+++ b/src/peers.c
@@ -1170,7 +1170,7 @@
struct stconn *cs = appctx_cs(appctx);
int n;
- n = co_getline(cs_oc(cs), trash.area, trash.size);
+ n = co_getline(sc_oc(cs), trash.area, trash.size);
if (!n)
return 0;
@@ -1184,7 +1184,7 @@
else
trash.area[n - 1] = 0;
- co_skip(cs_oc(cs), n);
+ co_skip(sc_oc(cs), n);
return n;
}
@@ -1211,7 +1211,7 @@
}
/* message to buffer */
- ret = ci_putblk(cs_ic(cs), trash.area, msglen);
+ ret = ci_putblk(sc_ic(cs), trash.area, msglen);
if (ret <= 0) {
if (ret == -1) {
/* No more write possible */
@@ -2024,7 +2024,7 @@
ignore_msg:
/* skip consumed message */
- co_skip(cs_oc(cs), totl);
+ co_skip(sc_oc(cs), totl);
TRACE_DEVEL("leaving in error", PEERS_EV_UPDTMSG);
return 0;
@@ -2307,7 +2307,7 @@
return 1;
ignore_msg:
- co_skip(cs_oc(cs), totl);
+ co_skip(sc_oc(cs), totl);
return 0;
malformed_exit:
@@ -2335,7 +2335,7 @@
struct stconn *cs = appctx_cs(appctx);
char *cur;
- reql = co_getblk(cs_oc(cs), msg_head, 2 * sizeof(char), *totl);
+ reql = co_getblk(sc_oc(cs), msg_head, 2 * sizeof(char), *totl);
if (reql <= 0) /* closed or EOL not found */
goto incomplete;
@@ -2349,11 +2349,11 @@
/* Read and Decode message length */
msg_head += *totl;
msg_head_sz -= *totl;
- reql = co_data(cs_oc(cs)) - *totl;
+ reql = co_data(sc_oc(cs)) - *totl;
if (reql > msg_head_sz)
reql = msg_head_sz;
- reql = co_getblk(cs_oc(cs), msg_head, reql, *totl);
+ reql = co_getblk(sc_oc(cs), msg_head, reql, *totl);
if (reql <= 0) /* closed */
goto incomplete;
@@ -2379,7 +2379,7 @@
return -1;
}
- reql = co_getblk(cs_oc(cs), trash.area, *msg_len, *totl);
+ reql = co_getblk(sc_oc(cs), trash.area, *msg_len, *totl);
if (reql <= 0) /* closed */
goto incomplete;
*totl += reql;
@@ -2388,7 +2388,7 @@
return 1;
incomplete:
- if (reql < 0 || (cs_oc(cs)->flags & (CF_SHUTW|CF_SHUTW_NOW))) {
+ if (reql < 0 || (sc_oc(cs)->flags & (CF_SHUTW|CF_SHUTW_NOW))) {
/* there was an error or the message was truncated */
appctx->st0 = PEER_SESS_ST_END;
return -1;
@@ -2860,7 +2860,7 @@
int prev_state;
/* Check if the input buffer is available. */
- if (cs_ib(cs)->size == 0) {
+ if (sc_ib(cs)->size == 0) {
cs_rx_room_blk(cs);
goto out;
}
@@ -2997,7 +2997,7 @@
}
}
- if (cs_ic(cs)->flags & CF_WRITE_PARTIAL)
+ if (sc_ic(cs)->flags & CF_WRITE_PARTIAL)
curpeer->statuscode = PEER_SESS_SC_CONNECTEDCODE;
reql = peer_getline(appctx);
@@ -3060,7 +3060,7 @@
curpeer->flags |= PEER_F_ALIVE;
/* skip consumed message */
- co_skip(cs_oc(cs), totl);
+ co_skip(sc_oc(cs), totl);
/* loop on that state to peek next message */
goto switchstate;
@@ -3129,13 +3129,13 @@
}
cs_shutw(cs);
cs_shutr(cs);
- cs_ic(cs)->flags |= CF_READ_NULL;
+ sc_ic(cs)->flags |= CF_READ_NULL;
goto out;
}
}
}
out:
- cs_oc(cs)->flags |= CF_READ_DONTWAIT;
+ sc_oc(cs)->flags |= CF_READ_DONTWAIT;
if (curpeer)
HA_SPIN_UNLOCK(PEER_LOCK, &curpeer->lock);
diff --git a/src/proxy.c b/src/proxy.c
index 92fc730..b3e2336 100644
--- a/src/proxy.c
+++ b/src/proxy.c
@@ -3141,7 +3141,7 @@
struct stconn *cs = appctx_cs(appctx);
extern const char *monthname[12];
- if (unlikely(cs_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
+ if (unlikely(sc_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
return 1;
chunk_reset(&trash);
diff --git a/src/resolvers.c b/src/resolvers.c
index 9add40b..82dbd41 100644
--- a/src/resolvers.c
+++ b/src/resolvers.c
@@ -2593,7 +2593,7 @@
struct list *stat_modules)
{
struct appctx *appctx = __cs_appctx(cs);
- struct channel *rep = cs_ic(cs);
+ struct channel *rep = sc_ic(cs);
struct stats_module *mod;
size_t idx = 0;
@@ -2628,7 +2628,7 @@
{
struct appctx *appctx = __cs_appctx(cs);
struct show_stat_ctx *ctx = appctx->svcctx;
- struct channel *rep = cs_ic(cs);
+ struct channel *rep = sc_ic(cs);
struct resolvers *resolver = ctx->obj1;
struct dns_nameserver *ns = ctx->obj2;
diff --git a/src/ring.c b/src/ring.c
index a389f5b..9ab0330 100644
--- a/src/ring.c
+++ b/src/ring.c
@@ -298,7 +298,7 @@
size_t len, cnt;
int ret;
- if (unlikely(cs_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
+ if (unlikely(sc_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
return 1;
HA_RWLOCK_WRLOCK(LOGSRV_LOCK, &ring->lock);
@@ -373,7 +373,7 @@
/* we've drained everything and are configured to wait for more
* data or an event (keypress, close)
*/
- if (!cs_oc(cs)->output && !(cs_oc(cs)->flags & CF_SHUTW)) {
+ if (!sc_oc(cs)->output && !(sc_oc(cs)->flags & CF_SHUTW)) {
/* let's be woken up once new data arrive */
HA_RWLOCK_WRLOCK(LOGSRV_LOCK, &ring->lock);
LIST_APPEND(&ring->waiters, &appctx->wait_entry);
@@ -382,7 +382,7 @@
ret = 0;
}
/* always drain all the request */
- co_skip(cs_oc(cs), cs_oc(cs)->output);
+ co_skip(sc_oc(cs), sc_oc(cs)->output);
}
return ret;
}
diff --git a/src/sink.c b/src/sink.c
index 94addd4..bfefea1 100644
--- a/src/sink.c
+++ b/src/sink.c
@@ -317,16 +317,16 @@
* and we don't want expire on this case
* with a syslog server
*/
- cs_oc(cs)->rex = TICK_ETERNITY;
+ sc_oc(cs)->rex = TICK_ETERNITY;
/* rto should not change but it seems the case */
- cs_oc(cs)->rto = TICK_ETERNITY;
+ sc_oc(cs)->rto = TICK_ETERNITY;
/* an error was detected */
- if (unlikely(cs_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
+ if (unlikely(sc_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
goto close;
/* con closed by server side */
- if ((cs_oc(cs)->flags & CF_SHUTW))
+ if ((sc_oc(cs)->flags & CF_SHUTW))
goto close;
/* if the connection is not established, inform the stream that we want
@@ -422,13 +422,13 @@
HA_SPIN_UNLOCK(SFT_LOCK, &sft->lock);
/* always drain data from server */
- co_skip(cs_oc(cs), cs_oc(cs)->output);
+ co_skip(sc_oc(cs), sc_oc(cs)->output);
return;
close:
cs_shutw(cs);
cs_shutr(cs);
- cs_ic(cs)->flags |= CF_READ_NULL;
+ sc_ic(cs)->flags |= CF_READ_NULL;
}
/*
@@ -457,16 +457,16 @@
* and we don't want expire on this case
* with a syslog server
*/
- cs_oc(cs)->rex = TICK_ETERNITY;
+ sc_oc(cs)->rex = TICK_ETERNITY;
/* rto should not change but it seems the case */
- cs_oc(cs)->rto = TICK_ETERNITY;
+ sc_oc(cs)->rto = TICK_ETERNITY;
/* an error was detected */
- if (unlikely(cs_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
+ if (unlikely(sc_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
goto close;
/* con closed by server side */
- if ((cs_oc(cs)->flags & CF_SHUTW))
+ if ((sc_oc(cs)->flags & CF_SHUTW))
goto close;
/* if the connection is not established, inform the stream that we want
@@ -566,13 +566,13 @@
HA_SPIN_UNLOCK(SFT_LOCK, &sft->lock);
/* always drain data from server */
- co_skip(cs_oc(cs), cs_oc(cs)->output);
+ co_skip(sc_oc(cs), sc_oc(cs)->output);
return;
close:
cs_shutw(cs);
cs_shutr(cs);
- cs_ic(cs)->flags |= CF_READ_NULL;
+ sc_ic(cs)->flags |= CF_READ_NULL;
}
void __sink_forward_session_deinit(struct sink_forward_target *sft)
diff --git a/src/ssl_ckch.c b/src/ssl_ckch.c
index 505353c..afcc6ad 100644
--- a/src/ssl_ckch.c
+++ b/src/ssl_ckch.c
@@ -2054,7 +2054,7 @@
if (trash == NULL)
goto error;
- if (unlikely(cs_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
+ if (unlikely(sc_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
goto error;
while (1) {
@@ -2795,7 +2795,7 @@
if (trash == NULL)
goto error;
- if (unlikely(cs_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
+ if (unlikely(sc_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
goto error;
while (1) {
diff --git a/src/ssl_crtlist.c b/src/ssl_crtlist.c
index 106648e..c06f3ac 100644
--- a/src/ssl_crtlist.c
+++ b/src/ssl_crtlist.c
@@ -1079,7 +1079,7 @@
/* for each bind_conf which use the crt-list, a new ckch_inst must be
* created.
*/
- if (unlikely(cs_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
+ if (unlikely(sc_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
goto error;
switch (ctx->state) {
diff --git a/src/stats.c b/src/stats.c
index ce6e614..494d143 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -312,7 +312,7 @@
static const char *stats_scope_ptr(struct appctx *appctx, struct stconn *cs)
{
struct show_stat_ctx *ctx = appctx->svcctx;
- struct channel *req = cs_oc(cs);
+ struct channel *req = sc_oc(cs);
struct htx *htx = htxbuf(&req->buf);
struct htx_blk *blk;
struct ist uri;
@@ -3019,7 +3019,7 @@
struct appctx *appctx = __cs_appctx(cs);
struct show_stat_ctx *ctx = appctx->svcctx;
struct stream *s = __cs_strm(cs);
- struct channel *rep = cs_ic(cs);
+ struct channel *rep = sc_ic(cs);
struct server *sv, *svs; /* server and server-state, server-state=server or server->track */
struct listener *l;
@@ -3679,7 +3679,7 @@
{
struct appctx *appctx = __cs_appctx(cs);
struct show_stat_ctx *ctx = appctx->svcctx;
- struct channel *rep = cs_ic(cs);
+ struct channel *rep = sc_ic(cs);
struct proxy *px;
/* dump proxies */
@@ -3727,7 +3727,7 @@
{
struct appctx *appctx = __cs_appctx(cs);
struct show_stat_ctx *ctx = appctx->svcctx;
- struct channel *rep = cs_ic(cs);
+ struct channel *rep = sc_ic(cs);
enum stats_domain domain = ctx->domain;
chunk_reset(&trash);
@@ -4285,8 +4285,8 @@
struct show_stat_ctx *ctx = appctx->svcctx;
struct stconn *cs = appctx_cs(appctx);
struct stream *s = __cs_strm(cs);
- struct channel *req = cs_oc(cs);
- struct channel *res = cs_ic(cs);
+ struct channel *req = sc_oc(cs);
+ struct channel *res = sc_ic(cs);
struct htx *req_htx, *res_htx;
/* only proxy stats are available via http */
diff --git a/src/stick_table.c b/src/stick_table.c
index 186181f..a3fc6f3 100644
--- a/src/stick_table.c
+++ b/src/stick_table.c
@@ -4680,7 +4680,7 @@
* data though.
*/
- if (unlikely(cs_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW))) {
+ if (unlikely(sc_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW))) {
/* in case of abort, remove any refcount we might have set on an entry */
if (ctx->state == STATE_DUMP) {
stksess_kill_if_expired(ctx->t, ctx->entry, 1);
diff --git a/src/stream.c b/src/stream.c
index 5e0fd58..882286d 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -3536,7 +3536,7 @@
goto done;
}
- if (unlikely(cs_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW))) {
+ if (unlikely(sc_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW))) {
/* If we're forced to shut down, we might have to remove our
* reference to the last stream being dumped.
*/