[MAJOR] http: add support for option http-server-close
This option enables HTTP keep-alive on the client side and close mode
on the server side. This offers the best latency on the slow client
side, and still saves as many resources as possible on the server side
by actively closing connections. Pipelining is supported on both requests
and responses, though there is currently no reason to get pipelined
responses.
diff --git a/include/types/proto_http.h b/include/types/proto_http.h
index 8a12939..c9ec7e3 100644
--- a/include/types/proto_http.h
+++ b/include/types/proto_http.h
@@ -56,7 +56,9 @@
#define TX_SVDENY 0x00000004 /* a server header matches a deny regex */
#define TX_SVALLOW 0x00000008 /* a server header matches an allow regex */
#define TX_CLTARPIT 0x00000010 /* the session is tarpitted (anti-dos) */
-/* unused: 0x00000020 */
+
+/* used only for keep-alive purposes, to indicate we're on a second transaction */
+#define TX_NOT_FIRST 0x00000020 /* the transaction is not the first one */
/* transaction flags dedicated to cookies : bits values 0x40, 0x80 (0-3 shift 6) */
#define TX_CK_NONE 0x00000000 /* this session had no cookie */
diff --git a/include/types/proxy.h b/include/types/proxy.h
index 92517ca..54190ee 100644
--- a/include/types/proxy.h
+++ b/include/types/proxy.h
@@ -100,12 +100,11 @@
#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 */
-/* unused : tcpsplice 0x08000000 */
+#define PR_O_SERVER_CLO 0x08000000 /* option http-server-close */
#define PR_O_CONTSTATS 0x10000000 /* continous counters */
#define PR_O_HTTP_PROXY 0x20000000 /* Enable session to use HTTP proxy operations */
#define PR_O_DISABLE404 0x40000000 /* Disable a server on a 404 response to a health-check */
#define PR_O_ORGTO 0x80000000 /* insert x-original-to with destination address */
-/* unused: 0x80000000 - now used by PR_O_ORGTO */
/* bits for proxy->options2 */
#define PR_O2_SPLIC_REQ 0x00000001 /* transfer requests using linux kernel's splice() */