static struct ist prefix = IST("haproxy_process_");
struct promex_ctx *ctx = appctx->svcctx;
struct field val;
- struct channel *chn = cs_ic(appctx_cs(appctx));
+ struct channel *chn = sc_ic(appctx_cs(appctx));
struct ist out = ist2(trash.area, 0);
size_t max = htx_get_max_blksz(htx, channel_htx_recv_max(chn, htx));
int ret = 1;
struct promex_ctx *ctx = appctx->svcctx;
struct proxy *px;
struct field val;
- struct channel *chn = cs_ic(appctx_cs(appctx));
+ struct channel *chn = sc_ic(appctx_cs(appctx));
struct ist out = ist2(trash.area, 0);
size_t max = htx_get_max_blksz(htx, channel_htx_recv_max(chn, htx));
struct field *stats = stat_l[STATS_DOMAIN_PROXY];
struct promex_ctx *ctx = appctx->svcctx;
struct proxy *px;
struct field val;
- struct channel *chn = cs_ic(appctx_cs(appctx));
+ struct channel *chn = sc_ic(appctx_cs(appctx));
struct ist out = ist2(trash.area, 0);
size_t max = htx_get_max_blksz(htx, channel_htx_recv_max(chn, htx));
struct field *stats = stat_l[STATS_DOMAIN_PROXY];
struct proxy *px;
struct server *sv;
struct field val;
- struct channel *chn = cs_ic(appctx_cs(appctx));
+ struct channel *chn = sc_ic(appctx_cs(appctx));
struct ist out = ist2(trash.area, 0);
size_t max = htx_get_max_blksz(htx, channel_htx_recv_max(chn, htx));
struct field *stats = stat_l[STATS_DOMAIN_PROXY];
struct proxy *px;
struct server *sv;
struct field val;
- struct channel *chn = cs_ic(appctx_cs(appctx));
+ struct channel *chn = sc_ic(appctx_cs(appctx));
struct ist out = ist2(trash.area, 0);
size_t max = htx_get_max_blksz(htx, channel_htx_recv_max(chn, htx));
struct field *stats = stat_l[STATS_DOMAIN_PROXY];
static struct ist prefix = IST("haproxy_sticktable_");
struct promex_ctx *ctx = appctx->svcctx;
struct field val;
- struct channel *chn = cs_ic(appctx_cs(appctx));
+ struct channel *chn = sc_ic(appctx_cs(appctx));
struct ist out = ist2(trash.area, 0);
size_t max = htx_get_max_blksz(htx, channel_htx_recv_max(chn, htx));
int ret = 1;
static int promex_parse_uri(struct appctx *appctx, struct stconn *cs)
{
struct promex_ctx *ctx = appctx->svcctx;
- 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 htx_sl *sl;
char *p, *key, *value;
* full. */
static int promex_send_headers(struct appctx *appctx, struct stconn *cs, struct htx *htx)
{
- struct channel *chn = cs_ic(cs);
+ struct channel *chn = sc_ic(cs);
struct htx_sl *sl;
unsigned int flags;
{
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;
int ret;
struct sedesc *se = appctx->sedesc;
int ret;
- ret = ci_putchk(cs_ic(se->sc), chunk);
+ ret = ci_putchk(sc_ic(se->sc), chunk);
if (ret == -1)
se_fl_set(se, SE_FL_RXBLK_ROOM);
struct sedesc *se = appctx->sedesc;
int ret;
- ret = ci_putblk(cs_ic(se->sc), blk, len);
+ ret = ci_putblk(sc_ic(se->sc), blk, len);
if (ret == -1)
se_fl_set(se, SE_FL_RXBLK_ROOM);
struct sedesc *se = appctx->sedesc;
int ret;
- ret = ci_putstr(cs_ic(se->sc), str);
+ ret = ci_putstr(sc_ic(se->sc), str);
if (ret == -1)
se_fl_set(se, SE_FL_RXBLK_ROOM);
struct sedesc *se = appctx->sedesc;
int ret;
- ret = ci_putchr(cs_ic(se->sc), chr);
+ ret = ci_putchr(sc_ic(se->sc), chr);
if (ret == -1)
se_fl_set(se, SE_FL_RXBLK_ROOM);
/* returns the channel which receives data from this stream connector (input channel) */
-static inline struct channel *cs_ic(struct stconn *cs)
+static inline struct channel *sc_ic(struct stconn *cs)
{
struct stream *strm = __cs_strm(cs);
}
/* returns the channel which feeds data to this stream connector (output channel) */
-static inline struct channel *cs_oc(struct stconn *cs)
+static inline struct channel *sc_oc(struct stconn *cs)
{
struct stream *strm = __cs_strm(cs);
}
/* returns the buffer which receives data from this stream connector (input channel's buffer) */
-static inline struct buffer *cs_ib(struct stconn *cs)
+static inline struct buffer *sc_ib(struct stconn *cs)
{
- return &cs_ic(cs)->buf;
+ return &sc_ic(cs)->buf;
}
/* returns the buffer which feeds data to this stream connector (output channel's buffer) */
-static inline struct buffer *cs_ob(struct stconn *cs)
+static inline struct buffer *sc_ob(struct stconn *cs)
{
- return &cs_oc(cs)->buf;
+ return &sc_oc(cs)->buf;
}
/* returns the stream's task associated to this stream connector */
static inline struct task *cs_strm_task(struct stconn *cs)
if (!__cs_strm(cs)->conn_err_type)
__cs_strm(cs)->conn_err_type = STRM_ET_DATA_ERR;
- cs_oc(cs)->flags |= CF_WRITE_ERROR;
- cs_ic(cs)->flags |= CF_READ_ERROR;
+ sc_oc(cs)->flags |= CF_WRITE_ERROR;
+ sc_ic(cs)->flags |= CF_READ_ERROR;
}
/* sets the current and previous state of a stream connector to <state>. This is
{
int ret;
- ret = channel_alloc_buffer(cs_ic(cs), wait);
+ ret = channel_alloc_buffer(sc_ic(cs), wait);
if (!ret)
cs_rx_buff_blk(cs);
return ret;
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);
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
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;
}
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;
}
*/
((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
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;
}
* 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)) {
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)
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;
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;
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;
/* 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;
}
*/
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;", '\\');
}
/* 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 */
* 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;
}
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);
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);
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);
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;
*/
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)
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;
}
*/
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)
/* 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 */
/* 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;
*/
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));
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;
*/
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));
*/
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));
!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)) {
}
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 &&
*/
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));
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;
*/
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));
/* 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 */
/* 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;
*/
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);
*/
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;
*/
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);
*/
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));
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;
{
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;
*/
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);
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);
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);
*/
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));
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)
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);
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);
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;
}
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) {
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;
/* 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;
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;
}
}
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)
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 */
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) {
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 */
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);
/* 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;
}
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:
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:
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
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
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) {
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;
}
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) {
*/
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));
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) {
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. */
{
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;
{
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;
{
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;
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;
{
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);
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;
/* 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;
}
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;
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;
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;
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)
/* 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)
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)
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)
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);
missing_data:
/* we need more data to read */
- cs_oc(cs)->flags |= CF_READ_DONTWAIT;
+ sc_oc(cs)->flags |= CF_READ_DONTWAIT;
return;
cs_shutw(cs);
cs_shutr(cs);
- cs_ic(cs)->flags |= CF_READ_NULL;
+ sc_ic(cs)->flags |= CF_READ_NULL;
return;
}
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.
*/
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);
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;
else
trash.area[n - 1] = 0;
- co_skip(cs_oc(cs), n);
+ co_skip(sc_oc(cs), n);
return n;
}
}
/* 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 */
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;
return 1;
ignore_msg:
- co_skip(cs_oc(cs), totl);
+ co_skip(sc_oc(cs), totl);
return 0;
malformed_exit:
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;
/* 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;
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;
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;
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;
}
}
}
- 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);
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;
}
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);
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);
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;
{
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;
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);
/* 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);
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;
}
* 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
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;
}
/*
* 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
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)
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) {
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) {
/* 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) {
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;
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;
{
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 */
{
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);
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 */
* 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);
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.
*/