From: Willy Tarreau Date: Mon, 31 May 2010 17:17:12 +0000 (+0200) Subject: [MAJOR] frontend: don't initialize the server-side stream_int anymore X-Git-Tag: v1.5-dev8~584 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a360d28e84e89f0d0f59996f88b50859de7d6e82;p=thirdparty%2Fhaproxy.git [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. --- diff --git a/src/frontend.c b/src/frontend.c index cdd46cef49..9bd793f754 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;