From 8f922fcc3ca0a9bbd08a7e6a9751072e32ce3ba6 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Sat, 6 Jan 2007 21:11:49 +0100 Subject: [PATCH] [MINOR] added the "tcpsplice" option it does nothing yet except set the minimal options. --- include/types/backend.h | 1 + include/types/global.h | 1 + src/cfgparse.c | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/include/types/backend.h b/include/types/backend.h index f70a3707c..d6079ad66 100644 --- a/include/types/backend.h +++ b/include/types/backend.h @@ -57,6 +57,7 @@ #define PR_O_TPXY_CIP 0x04000000 /* bind to the client's IP address when connect()ing */ #define PR_O_TPXY_CLI 0x06000000 /* bind to the client's IP+port when connect()ing */ #define PR_O_TPXY_MASK 0x06000000 /* bind to a non-local address when connect()ing */ +#define PR_O_TCPSPLICE 0x08000000 /* delegate data transfer to linux kernel's tcp_splice */ #endif /* _TYPES_BACKEND_H */ diff --git a/include/types/global.h b/include/types/global.h index 40c6c997a..222d4feac 100644 --- a/include/types/global.h +++ b/include/types/global.h @@ -42,6 +42,7 @@ #define LSTCHK_CAP_BIND 0x00000001 /* check that we can bind to any port */ #define LSTCHK_CTTPROXY 0x00000002 /* check that tproxy is enabled */ #define LSTCHK_NETADM 0x00000004 /* check that we have CAP_NET_ADMIN */ +#define LSTCHK_TCPSPLICE 0x00000008 /* check that linux tcp_splice is enabled */ /* FIXME : this will have to be redefined correctly */ struct global { diff --git a/src/cfgparse.c b/src/cfgparse.c index 5017d50d0..8b6e94d36 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -94,6 +94,10 @@ static const struct { { "allbackups", PR_O_USE_ALL_BK, PR_CAP_BE, 0 }, { "persist", PR_O_PERSIST, PR_CAP_BE, 0 }, { "forceclose", PR_O_FORCE_CLO | PR_O_HTTP_CLOSE, PR_CAP_BE, 0 }, +#ifdef CONFIG_HAP_TCPSPLICE + { "tcpsplice", PR_O_TCPSPLICE , PR_CAP_BE|PR_CAP_FE, LSTCHK_TCPSPLICE|LSTCHK_NETADM }, +#endif + { NULL, 0, 0 } };