]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MAJOR] frontend: don't initialize the server-side stream_int anymore
authorWilly Tarreau <w@1wt.eu>
Mon, 31 May 2010 17:17:12 +0000 (19:17 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 14 Jun 2010 08:53:15 +0000 (10:53 +0200)
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

index cdd46cef49aa61b74c0cd7a22ee5957631b25a6a..9bd793f754db692c23f44ba754a5e304ec4981d5 100644 (file)
@@ -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;