diff --git a/include/types/session.h b/include/types/session.h index d37d2ebf6..574f93341 100644 --- a/include/types/session.h +++ b/include/types/session.h @@ -157,9 +157,6 @@ struct session { /* 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 */ diff --git a/src/backend.c b/src/backend.c index e9125b46d..986c07072 100644 --- a/src/backend.c +++ b/src/backend.c @@ -1664,7 +1664,7 @@ int connect_server(struct session *s) /* 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 ! @@ -1677,7 +1677,7 @@ int connect_server(struct session *s) #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 diff --git a/src/client.c b/src/client.c index d3cf47dbd..a01bb527e 100644 --- a/src/client.c +++ b/src/client.c @@ -46,8 +46,8 @@ void get_frt_addr(struct session *s) { 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; } @@ -170,7 +170,6 @@ int event_accept(int fd) { 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 */ @@ -183,7 +182,6 @@ int event_accept(int fd) { 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; diff --git a/src/haproxy.c b/src/haproxy.c index c936bf05f..261a4be49 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -325,17 +325,11 @@ void dump(int sig) 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 */ diff --git a/src/proto_uxst.c b/src/proto_uxst.c index 0cb365ce8..b3bf7545c 100644 --- a/src/proto_uxst.c +++ b/src/proto_uxst.c @@ -441,7 +441,6 @@ int uxst_event_accept(int fd) { s->fe = NULL; s->be = NULL; - s->cli_state = CL_STDATA; s->ana_state = 0; s->req = s->rep = NULL; /* will be allocated later */ @@ -454,7 +453,6 @@ int uxst_event_accept(int fd) { 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; @@ -939,7 +937,7 @@ void uxst_process_session(struct task *t, int *next) } actconn--; - listener = fdtab[s->cli_fd].listener; + listener = fdtab[s->si[0].fd].listener; if (listener) { listener->nbconn--; if (listener->state == LI_FULL && diff --git a/src/session.c b/src/session.c index 29ddb6f93..e19bb5630 100644 --- a/src/session.c +++ b/src/session.c @@ -151,15 +151,6 @@ int sess_update_st_con_tcp(struct session *s, struct stream_interface *si) 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.