From a360d28e84e89f0d0f59996f88b50859de7d6e82 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 31 May 2010 19:17:12 +0200 Subject: [PATCH] [MAJOR] frontend: don't initialize the server-side stream_int anymore The frontend has no reason to initialize the server-side stream_interface. It's a leftover from old times which now makes no sense due to the fact that we don't know in the frontend whether the other side will be a socket, a task or anything else. Removing this part is possible due to previous patches which perform the initialization at the proper place. We'll still have to be able to register an I/O handler for situations where everything is known only to the frontend (eg: unix stats socket), before merging the various instanciations of this accept() function. --- src/frontend.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/frontend.c b/src/frontend.c index cdd46cef4..9bd793f75 100644 --- a/src/frontend.c +++ b/src/frontend.c @@ -142,21 +142,15 @@ int frontend_accept(struct listener *l, int cfd, struct sockaddr_storage *addr) return 0; } - /* pre-initialize the other side's stream interface */ - + /* pre-initialize the other side's stream interface to an INIT state */ + s->si[1].owner = t; s->si[1].state = s->si[1].prev_state = SI_ST_INI; s->si[1].err_type = SI_ET_NONE; s->si[1].err_loc = NULL; - s->si[1].owner = t; - s->si[1].update = stream_sock_data_finish; - s->si[1].shutr = stream_sock_shutr; - s->si[1].shutw = stream_sock_shutw; - s->si[1].chk_rcv = stream_sock_chk_rcv; - s->si[1].chk_snd = stream_sock_chk_snd; - s->si[1].connect = tcpv4_connect_server; s->si[1].iohandler = NULL; s->si[1].exp = TICK_ETERNITY; s->si[1].fd = -1; /* just to help with debugging */ + s->si[1].flags = SI_FL_NONE; if (likely(s->be->options2 & PR_O2_INDEPSTR)) s->si[1].flags |= SI_FL_INDEP_STR;