/* application specific below */
struct proxy *fe; /* the proxy this session depends on for the client side */
struct proxy *be; /* the proxy this session depends on for the server side */
- int cli_fd; /* the client side fd */
- int cli_state; /* state of the client side */
- int srv_state; /* state of the server side */
int conn_retries; /* number of connect retries left */
int flags; /* some flags describing the session */
unsigned term_trace; /* term trace: 4*8 bits indicating which part of the code closed */
/* this is a resource error */
return SN_ERR_RESOURCE;
}
-
+
if (fd >= global.maxsock) {
/* do not log anything there, it's a normal condition when this option
* is used to serialize connections to a server !
#ifdef CONFIG_HAP_TCPSPLICE
if ((s->fe->options & s->be->options) & PR_O_TCPSPLICE) {
/* TCP splicing supported by both FE and BE */
- tcp_splice_initfd(s->cli_fd, fd);
+ tcp_splice_initfd(s->req->prod->fd, fd);
}
#endif
{
socklen_t namelen = sizeof(s->frt_addr);
- if (get_original_dst(s->cli_fd, (struct sockaddr_in *)&s->frt_addr, &namelen) == -1)
- getsockname(s->cli_fd, (struct sockaddr *)&s->frt_addr, &namelen);
+ if (get_original_dst(s->si[0].fd, (struct sockaddr_in *)&s->frt_addr, &namelen) == -1)
+ getsockname(s->si[0].fd, (struct sockaddr *)&s->frt_addr, &namelen);
s->flags |= SN_FRT_ADDR_SET;
}
s->flags |= SN_BE_ASSIGNED;
}
- s->cli_state = CL_STDATA;
s->ana_state = 0; /* analysers may change it but must reset it upon exit */
s->req = s->rep = NULL; /* will be allocated later */
s->si[0].fd = cfd;
s->si[0].flags = SI_FL_NONE;
s->si[0].exp = TICK_ETERNITY;
- s->cli_fd = cfd;
s->si[1].state = s->si[1].prev_state = SI_ST_INI;
s->si[1].err_type = SI_ET_NONE;
t = rb_entry(node, struct task, rb_node);
s = t->context;
qfprintf(stderr,"[dump] wq: task %p, still %ld ms, "
- "cli=%d, srv=%d, cr=%d, cw=%d, sr=%d, sw=%d, "
- "req=%d, rep=%d, clifd=%d\n",
+ "cli=%d, srv=%d, req=%d, rep=%d\n",
s, tv_ms_remain(&now, &t->expire),
- s->cli_state,
- s->srv_state,
- EV_FD_ISSET(s->cli_fd, DIR_RD),
- EV_FD_ISSET(s->cli_fd, DIR_WR),
- EV_FD_ISSET(s->srv_fd, DIR_RD),
- EV_FD_ISSET(s->srv_fd, DIR_WR),
- s->req->l, s->rep?s->rep->l:0, s->cli_fd
- );
+ s->si[0].state,
+ s->si[1].state,
+ s->req->l, s->rep?s->rep->l:0);
}
#endif
/* dump memory usage then free everything possible */
s->fe = NULL;
s->be = NULL;
- s->cli_state = CL_STDATA;
s->ana_state = 0;
s->req = s->rep = NULL; /* will be allocated later */
s->si[0].fd = cfd;
s->si[0].flags = SI_FL_NONE;
s->si[0].exp = TICK_ETERNITY;
- s->cli_fd = cfd;
s->si[1].state = s->si[1].prev_state = SI_ST_INI;
s->si[1].err_type = SI_ET_NONE;
}
actconn--;
- listener = fdtab[s->cli_fd].listener;
+ listener = fdtab[s->si[0].fd].listener;
if (listener) {
listener->nbconn--;
if (listener->state == LI_FULL &&
struct buffer *req = si->ob;
struct buffer *rep = si->ib;
- DPRINTF(stderr,"[%u] %s: c=%s exp(r,w)=%u,%u req=%08x rep=%08x rql=%d rpl=%d, fds=%d\n",
- now_ms, __FUNCTION__,
- cli_stnames[s->cli_state],
- rep->rex, req->wex,
- req->flags, rep->flags,
- req->l, rep->l,
- fdtab[si->fd].state);
-
-
/* If we got an error, or if nothing happened and the connection timed
* out, we must give up. The CER state handler will take care of retry
* attempts and error reports.