]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stream_interface: add a client target : TARG_TYPE_CLIENT
authorWilly Tarreau <w@1wt.eu>
Fri, 11 May 2012 12:47:34 +0000 (14:47 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 11 May 2012 12:47:34 +0000 (14:47 +0200)
This one will be used to identify the direction the SI is being used. All
incoming connections have a target of type TARG_TYPE_CLIENT.

include/proto/stream_interface.h
include/types/stream_interface.h
src/peers.c
src/session.c

index 21236962072cbe665a93afbad3bb65cac2516d3a..cbe8282573406c539b2a85e92f809bc11744d8c4 100644 (file)
@@ -56,6 +56,12 @@ static inline void clear_target(struct target *dest)
        dest->ptr.v = NULL;
 }
 
+static inline void set_target_client(struct target *dest)
+{
+       dest->type = TARG_TYPE_CLIENT;
+       dest->ptr.v = NULL;
+}
+
 static inline void set_target_server(struct target *dest, struct server *s)
 {
        dest->type = TARG_TYPE_SERVER;
index fb2b258e5856dadfedd0d73d7f7b50528d07a5e1..2c57acd318cb7c2fd0fe0bac20717b1025ba46ac 100644 (file)
@@ -80,6 +80,7 @@ enum {
 /* target types */
 enum {
        TARG_TYPE_NONE = 0,         /* no target set, pointer is NULL by definition */
+       TARG_TYPE_CLIENT,           /* target is a client, pointer is NULL by definition */
        TARG_TYPE_PROXY,            /* target is a proxy   ; use address with the proxy's settings */
        TARG_TYPE_SERVER,           /* target is a server  ; use address with server's and its proxy's settings */
        TARG_TYPE_APPLET,           /* target is an applet ; use only the applet */
index a3408f5a5da28ad5b5fdd639243a92f94bf891a8..6d84b4e458ac8ebadf0290ea8f9f3a8a42045e01 100644 (file)
@@ -1157,7 +1157,7 @@ static struct session *peer_session_create(struct peer *peer, struct peer_sessio
        s->si[0].proto   = NULL;
        s->si[0].release = NULL;
        s->si[0].send_proxy_ofs = 0;
-       clear_target(&s->si[0].target);
+       set_target_client(&s->si[0].target);
        s->si[0].exp = TICK_ETERNITY;
        s->si[0].flags = SI_FL_NONE;
        if (s->fe->options2 & PR_O2_INDEPSTR)
index 30245992871c084914424f880ff43516e21535c3..77fc32e8e1580b57e71f80a3a463c6832415c6e2 100644 (file)
@@ -173,7 +173,7 @@ int session_accept(struct listener *l, int cfd, struct sockaddr_storage *addr)
        s->si[0].proto     = l->proto;
        s->si[0].release   = NULL;
        s->si[0].send_proxy_ofs = 0;
-       clear_target(&s->si[0].target);
+       set_target_client(&s->si[0].target);
        s->si[0].exp       = TICK_ETERNITY;
        s->si[0].flags     = SI_FL_NONE;