summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilly Tarreau <w@1wt.eu>2020-06-04 18:58:52 +0200
committerWilly Tarreau <w@1wt.eu>2020-06-05 20:19:07 +0200
commita39136ba9f2ad2215b11d7a77129aa137b65dda4 (patch)
tree60d23ead51abf8d160dc083d0e9a2455cc0b85e0
parent774f9edb53a23c778596ea0e4d6d392129f636f7 (diff)
downloadhaproxy-a39136ba9f2ad2215b11d7a77129aa137b65dda4.tar.gz
REORG: include: move session.h to haproxy/session{,-t}.h
Almost no change was needed beyond a little bit of reordering of the types file and adjustments to use session-t instead of session at a few places.
-rw-r--r--include/haproxy/connection.h2
-rw-r--r--include/haproxy/session-t.h (renamed from include/types/session.h)30
-rw-r--r--include/haproxy/session.h (renamed from include/proto/session.h)20
-rw-r--r--include/haproxy/tcp_rules.h2
-rw-r--r--include/haproxy/vars.h2
-rw-r--r--include/types/stream.h2
-rw-r--r--src/backend.c2
-rw-r--r--src/cfgparse.c2
-rw-r--r--src/cli.c2
-rw-r--r--src/fcgi-app.c2
-rw-r--r--src/flt_spoe.c2
-rw-r--r--src/haproxy.c2
-rw-r--r--src/hlua.c2
-rw-r--r--src/mux_fcgi.c3
-rw-r--r--src/mux_h1.c3
-rw-r--r--src/mux_h2.c3
-rw-r--r--src/peers.c2
-rw-r--r--src/session.c4
-rw-r--r--src/stats.c2
-rw-r--r--src/stream.c2
20 files changed, 42 insertions, 49 deletions
diff --git a/include/haproxy/connection.h b/include/haproxy/connection.h
index 77556bf04..0f44fcecb 100644
--- a/include/haproxy/connection.h
+++ b/include/haproxy/connection.h
@@ -30,9 +30,9 @@
#include <haproxy/listener-t.h>
#include <haproxy/obj_type.h>
#include <haproxy/pool.h>
+#include <haproxy/session.h>
#include <haproxy/task-t.h>
-#include <proto/session.h>
extern struct pool_head *pool_head_connection;
extern struct pool_head *pool_head_connstream;
diff --git a/include/types/session.h b/include/haproxy/session-t.h
index bc89b5642..335914bbe 100644
--- a/include/types/session.h
+++ b/include/haproxy/session-t.h
@@ -1,8 +1,8 @@
/*
- * include/types/session.h
+ * include/haproxy/session-t.h
* This file defines everything related to sessions.
*
- * Copyright (C) 2000-2015 Willy Tarreau - w@1wt.eu
+ * Copyright (C) 2000-2020 Willy Tarreau - w@1wt.eu
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -19,8 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef _TYPES_SESSION_H
-#define _TYPES_SESSION_H
+#ifndef _HAPROXY_SESSION_T_H
+#define _HAPROXY_SESSION_T_H
#include <sys/time.h>
@@ -31,18 +31,10 @@
#include <haproxy/types.h>
#include <haproxy/list-t.h>
#include <haproxy/obj_type-t.h>
-#include <haproxy/vars-t.h>
-
#include <haproxy/stick_table-t.h>
#include <haproxy/task-t.h>
+#include <haproxy/vars-t.h>
-struct sess_srv_list {
- void *target;
- struct list conn_list; /* Head of the connections list */
- struct list srv_list; /* Next element of the server list */
-};
-
-#define MAX_SRV_LIST 5
/* session flags */
enum {
@@ -50,7 +42,9 @@ enum {
SESS_FL_PREFER_LAST = 0x00000001, /* NTML authent, we should reuse last conn */
};
-struct proxy;
+/* max number of idle server connections kept attached to a session */
+#define MAX_SRV_LIST 5
+
struct session {
struct proxy *fe; /* the proxy this session depends on for the client side */
struct listener *listener; /* the listener by which the request arrived */
@@ -66,7 +60,13 @@ struct session {
unsigned int flags; /* session flags, SESS_FL_* */
};
-#endif /* _TYPES_SESSION_H */
+struct sess_srv_list {
+ void *target;
+ struct list conn_list; /* Head of the connections list */
+ struct list srv_list; /* Next element of the server list */
+};
+
+#endif /* _HAPROXY_SESSION_T_H */
/*
* Local variables:
diff --git a/include/proto/session.h b/include/haproxy/session.h
index bbd2b66b3..750de26ca 100644
--- a/include/proto/session.h
+++ b/include/haproxy/session.h
@@ -1,8 +1,8 @@
/*
- * include/proto/session.h
- * This file defines everything related to sessions.
+ * include/haproxy/session.h
+ * This file contains functions used to manage sessions.
*
- * Copyright (C) 2000-2015 Willy Tarreau - w@1wt.eu
+ * Copyright (C) 2000-2020 Willy Tarreau - w@1wt.eu
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -19,16 +19,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef _PROTO_SESSION_H
-#define _PROTO_SESSION_H
+#ifndef _HAPROXY_SESSION_H
+#define _HAPROXY_SESSION_H
#include <haproxy/base.h>
-#include <haproxy/obj_type.h>
-#include <haproxy/pool.h>
-
#include <haproxy/global-t.h>
-#include <types/session.h>
-
+#include <haproxy/obj_type-t.h>
+#include <haproxy/pool.h>
+#include <haproxy/session-t.h>
#include <haproxy/stick_table.h>
#include <proto/server.h>
@@ -133,7 +131,7 @@ static inline int session_check_idle_conn(struct session *sess, struct connectio
return 0;
}
-#endif /* _PROTO_SESSION_H */
+#endif /* _HAPROXY_SESSION_H */
/*
* Local variables:
diff --git a/include/haproxy/tcp_rules.h b/include/haproxy/tcp_rules.h
index ec57359ce..c90fa30c8 100644
--- a/include/haproxy/tcp_rules.h
+++ b/include/haproxy/tcp_rules.h
@@ -24,8 +24,8 @@
#include <haproxy/action-t.h>
#include <haproxy/base.h>
+#include <haproxy/session-t.h>
#include <types/stream.h>
-#include <types/session.h>
int tcp_inspect_request(struct stream *s, struct channel *req, int an_bit);
int tcp_inspect_response(struct stream *s, struct channel *rep, int an_bit);
diff --git a/include/haproxy/vars.h b/include/haproxy/vars.h
index 8d64fda32..345be767a 100644
--- a/include/haproxy/vars.h
+++ b/include/haproxy/vars.h
@@ -22,8 +22,8 @@
#ifndef _HAPROXY_VARS_H
#define _HAPROXY_VARS_H
-#include <types/session.h>
#include <types/stream.h>
+#include <haproxy/session-t.h>
#include <haproxy/types.h>
#include <haproxy/vars-t.h>
diff --git a/include/types/stream.h b/include/types/stream.h
index 6e489a0f2..af11f9065 100644
--- a/include/types/stream.h
+++ b/include/types/stream.h
@@ -33,6 +33,7 @@
#include <haproxy/hlua-t.h>
#include <haproxy/list-t.h>
#include <haproxy/obj_type-t.h>
+#include <haproxy/session-t.h>
#include <haproxy/vars-t.h>
#include <types/channel.h>
@@ -41,7 +42,6 @@
#include <types/proxy.h>
#include <types/queue.h>
#include <types/server.h>
-#include <types/session.h>
#include <types/stream_interface.h>
#include <haproxy/task-t.h>
#include <haproxy/stick_table-t.h>
diff --git a/src/backend.c b/src/backend.c
index 768e8774b..48ca89cf9 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -32,6 +32,7 @@
#include <haproxy/lb_fwrr.h>
#include <haproxy/obj_type.h>
#include <haproxy/payload.h>
+#include <haproxy/session.h>
#include <haproxy/task.h>
#include <haproxy/ticks.h>
#include <haproxy/time.h>
@@ -52,7 +53,6 @@
#include <proto/queue.h>
#include <haproxy/sample.h>
#include <proto/server.h>
-#include <proto/session.h>
#include <proto/stream.h>
#include <proto/stream_interface.h>
#include <proto/ssl_sock.h>
diff --git a/src/cfgparse.c b/src/cfgparse.c
index 5ae821e27..44fa9c4cb 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -54,6 +54,7 @@
#include <haproxy/obj_type-t.h>
#include <haproxy/peers-t.h>
#include <haproxy/pool.h>
+#include <haproxy/session.h>
#include <haproxy/tools.h>
#include <haproxy/time.h>
#include <common/uri_auth.h>
@@ -77,7 +78,6 @@
#include <proto/proxy.h>
#include <haproxy/peers.h>
#include <haproxy/sample.h>
-#include <proto/session.h>
#include <proto/server.h>
#include <proto/stream.h>
#include <haproxy/stick_table.h>
diff --git a/src/cli.c b/src/cli.c
index 7b0a634a8..d07f0953c 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -37,6 +37,7 @@
#include <haproxy/pattern-t.h>
#include <haproxy/peers.h>
#include <haproxy/sample-t.h>
+#include <haproxy/session.h>
#include <haproxy/task.h>
#include <haproxy/tools.h>
#include <haproxy/ticks.h>
@@ -61,7 +62,6 @@
#include <haproxy/pipe.h>
#include <haproxy/protocol.h>
#include <proto/proxy.h>
-#include <proto/session.h>
#include <proto/stream.h>
#include <proto/server.h>
#include <proto/stream_interface.h>
diff --git a/src/fcgi-app.c b/src/fcgi-app.c
index da0cfb09a..8da6eed93 100644
--- a/src/fcgi-app.c
+++ b/src/fcgi-app.c
@@ -18,6 +18,7 @@
#include <haproxy/http_htx.h>
#include <haproxy/regex.h>
#include <haproxy/sample.h>
+#include <haproxy/session.h>
#include <haproxy/tools.h>
#include <haproxy/global.h>
@@ -28,7 +29,6 @@
#include <proto/log.h>
#include <proto/proxy.h>
#include <proto/server.h>
-#include <proto/session.h>
/* Global list of all FCGI applications */
static struct fcgi_app *fcgi_apps = NULL;
diff --git a/src/flt_spoe.c b/src/flt_spoe.c
index 59cfca210..2d992a680 100644
--- a/src/flt_spoe.c
+++ b/src/flt_spoe.c
@@ -21,6 +21,7 @@
#include <haproxy/signal.h>
#include <haproxy/thread.h>
#include <haproxy/pool.h>
+#include <haproxy/session.h>
#include <haproxy/task.h>
#include <haproxy/tcp_rules.h>
#include <haproxy/time.h>
@@ -38,7 +39,6 @@
#include <proto/log.h>
#include <proto/http_ana.h>
#include <proto/proxy.h>
-#include <proto/session.h>
#include <proto/spoe.h>
#include <proto/stream.h>
#include <proto/stream_interface.h>
diff --git a/src/haproxy.c b/src/haproxy.c
index 1a13a4644..b80e88ba2 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -102,6 +102,7 @@
#include <haproxy/peers.h>
#include <haproxy/sample.h>
#include <haproxy/regex.h>
+#include <haproxy/session.h>
#include <haproxy/signal.h>
#include <haproxy/tools.h>
#include <haproxy/time.h>
@@ -131,7 +132,6 @@
#include <proto/proxy.h>
#include <proto/queue.h>
#include <proto/server.h>
-#include <proto/session.h>
#include <proto/stream.h>
#include <proto/ssl_sock.h>
diff --git a/src/hlua.c b/src/hlua.c
index 7ddea168b..99342d56f 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -40,6 +40,7 @@
#include <haproxy/pattern.h>
#include <haproxy/payload.h>
#include <haproxy/sample.h>
+#include <haproxy/session.h>
#include <haproxy/task.h>
#include <haproxy/tcp_rules.h>
#include <haproxy/tools.h>
@@ -57,7 +58,6 @@
#include <proto/queue.h>
#include <proto/http_ana.h>
#include <proto/server.h>
-#include <proto/session.h>
#include <proto/stream.h>
#include <proto/stream_interface.h>
diff --git a/src/mux_fcgi.c b/src/mux_fcgi.c
index ae1e82b6b..2c3db735f 100644
--- a/src/mux_fcgi.c
+++ b/src/mux_fcgi.c
@@ -22,13 +22,12 @@
#include <haproxy/list.h>
#include <haproxy/net_helper.h>
#include <haproxy/regex.h>
+#include <haproxy/session-t.h>
#include <types/proxy.h>
-#include <types/session.h>
#include <proto/fcgi-app.h>
#include <proto/log.h>
-#include <proto/session.h>
#include <proto/ssl_sock.h>
#include <proto/stream.h>
#include <proto/stream_interface.h>
diff --git a/src/mux_h1.c b/src/mux_h1.c
index 13d80f795..b7a3c5da8 100644
--- a/src/mux_h1.c
+++ b/src/mux_h1.c
@@ -22,11 +22,10 @@
#include <haproxy/pipe-t.h>
#include <types/proxy.h>
-#include <types/session.h>
#include <haproxy/http_htx.h>
#include <proto/log.h>
-#include <proto/session.h>
+#include <haproxy/session-t.h>
#include <proto/stream.h>
#include <proto/stream_interface.h>
#include <proto/trace.h>
diff --git a/src/mux_h2.c b/src/mux_h2.c
index 048f0297f..1a5c8ad4c 100644
--- a/src/mux_h2.c
+++ b/src/mux_h2.c
@@ -22,11 +22,10 @@
#include <haproxy/http_htx.h>
#include <haproxy/htx.h>
#include <haproxy/net_helper.h>
+#include <haproxy/session-t.h>
#include <proto/trace.h>
-#include <proto/session.h>
#include <proto/stream.h>
#include <proto/stream_interface.h>
-#include <types/session.h>
#include <import/eb32tree.h>
diff --git a/src/peers.c b/src/peers.c
index d77044150..32409b1b5 100644
--- a/src/peers.c
+++ b/src/peers.c
@@ -27,6 +27,7 @@
#include <haproxy/obj_type-t.h>
#include <haproxy/peers.h>
#include <haproxy/task.h>
+#include <haproxy/session-t.h>
#include <haproxy/signal.h>
#include <haproxy/time.h>
#include <haproxy/tools.h>
@@ -41,7 +42,6 @@
#include <haproxy/fd.h>
#include <proto/log.h>
#include <proto/proxy.h>
-#include <proto/session.h>
#include <proto/stream.h>
#include <haproxy/stick_table.h>
#include <proto/stream_interface.h>
diff --git a/src/session.c b/src/session.c
index a5e441dc7..5a36afc70 100644
--- a/src/session.c
+++ b/src/session.c
@@ -16,14 +16,12 @@
#include <haproxy/http.h>
#include <haproxy/listener.h>
#include <haproxy/pool.h>
+#include <haproxy/session.h>
#include <haproxy/tcp_rules.h>
#include <haproxy/vars.h>
-#include <types/session.h>
-
#include <proto/log.h>
#include <proto/proxy.h>
-#include <proto/session.h>
#include <proto/stream.h>
DECLARE_POOL(pool_head_session, "session", sizeof(struct session));
diff --git a/src/stats.c b/src/stats.c
index c7d125596..e7e2237b9 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -40,6 +40,7 @@
#include <haproxy/listener.h>
#include <haproxy/map-t.h>
#include <haproxy/pattern-t.h>
+#include <haproxy/session.h>
#include <haproxy/task.h>
#include <haproxy/tools.h>
#include <haproxy/ticks.h>
@@ -61,7 +62,6 @@
#include <proto/log.h>
#include <haproxy/pipe.h>
#include <proto/proxy.h>
-#include <proto/session.h>
#include <proto/ssl_sock.h>
#include <proto/stream.h>
#include <proto/server.h>
diff --git a/src/stream.c b/src/stream.c
index d0999a266..2c0a4f153 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -31,6 +31,7 @@
#include <haproxy/thread.h>
#include <haproxy/htx.h>
#include <haproxy/pool.h>
+#include <haproxy/session.h>
#include <haproxy/task.h>
#include <haproxy/tcp_rules.h>
#include <haproxy/vars.h>
@@ -51,7 +52,6 @@
#include <proto/filters.h>
#include <haproxy/freq_ctr.h>
#include <proto/log.h>
-#include <proto/session.h>
#include <proto/stream.h>
#include <haproxy/pipe.h>
#include <proto/http_ana.h>