[PATCH] Add the possibility to compress requests

2023-04-03 Thread Olivier Houchard
Hi,

The attached patchset is a first attempt at adding the possibility to
compress requests, as well as responses.
It adds a new keyword for compression, "tocompress" (any better
alternative name would be appreciated). The valid values are "request",
if you want to compress requests, "response" if you want to compress
responses or "both", if you want to compress both.
The default is to compress responses only.

Any comment is more than welcome.

Thanks!

Olivier
>From 6c3e62baa888359521091387ce6ac8376a001259 Mon Sep 17 00:00:00 2001
From: Olivier Houchard 
Date: Mon, 3 Apr 2023 22:22:24 +0200
Subject: [PATCH 1/2] MINOR: compression: Make compression offload a flag

Turn compression offload into a flag in struct comp, instead of using
an int just for it.
---
 include/haproxy/compression-t.h | 5 -
 src/flt_http_comp.c | 6 +++---
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/include/haproxy/compression-t.h b/include/haproxy/compression-t.h
index 062f17f76..cdbf0d14e 100644
--- a/include/haproxy/compression-t.h
+++ b/include/haproxy/compression-t.h
@@ -34,10 +34,13 @@
 
 #include 
 
+/* Compression flags */
+
+#define COMP_FL_OFFLOAD		0x0001 /* Compression offload */
 struct comp {
 	struct comp_algo *algos;
 	struct comp_type *types;
-	unsigned int offload;
+	unsigned int flags;
 };
 
 struct comp_ctx {
diff --git a/src/flt_http_comp.c b/src/flt_http_comp.c
index ceda3fd5e..507009692 100644
--- a/src/flt_http_comp.c
+++ b/src/flt_http_comp.c
@@ -451,8 +451,8 @@ select_compression_request_header(struct comp_state *st, struct stream *s, struc
 
 	/* remove all occurrences of the header when "compression offload" is set */
 	if (st->comp_algo) {
-		if ((s->be->comp && s->be->comp->offload) ||
-		(strm_fe(s)->comp && strm_fe(s)->comp->offload)) {
+		if ((s->be->comp && (s->be->comp->flags & COMP_FL_OFFLOAD)) ||
+		(strm_fe(s)->comp && (strm_fe(s)->comp->flags & COMP_FL_OFFLOAD))) {
 			http_remove_header(htx, );
 			ctx.blk = NULL;
 			while (http_find_header(htx, ist("Accept-Encoding"), , 1))
@@ -690,7 +690,7 @@ parse_compression_options(char **args, int section, struct proxy *proxy,
   args[0], args[1]);
 			ret = 1;
 		}
-		comp->offload = 1;
+		comp->flags |= COMP_FL_OFFLOAD;
 	}
 	else if (strcmp(args[1], "type") == 0) {
 		int cur_arg = 2;
-- 
2.39.1

>From 77a5657592338db2ed53189c50828b3c0ed52716 Mon Sep 17 00:00:00 2001
From: Olivier Houchard 
Date: Tue, 4 Apr 2023 00:14:36 +0200
Subject: [PATCH 2/2] MEDIUM: compression: allow to compress requests too.

Make it so we can compress requests, as well as responses.
A new compress keyword is added, "tocompress". It takes exactly one
argument. The valid values for that arguments are "response", if we want
to compress only responses, "request", if we want to compress only
requests, or "both", if we want to compress both.
The dafault value is "response".
---
 doc/configuration.txt   |  12 ++-
 include/haproxy/compression-t.h |   3 +
 src/flt_http_comp.c | 165 +++-
 3 files changed, 154 insertions(+), 26 deletions(-)

diff --git a/doc/configuration.txt b/doc/configuration.txt
index 586689ca2..8f86b285e 100644
--- a/doc/configuration.txt
+++ b/doc/configuration.txt
@@ -5077,7 +5077,7 @@ compression type  ...
 compression algo gzip
 compression type text/html text/plain
 
-  See also : "compression offload"
+  See also : "compression offload", "compression tocompress"
 
 compression offload
   Makes HAProxy work as a compression offloader only.
@@ -5099,7 +5099,15 @@ compression offload
   If this setting is used in a defaults section, a warning is emitted and the
   option is ignored.
 
-  See also : "compression type", "compression algo"
+  See also : "compression type", "compression algo", "compression tocompress"
+
+compression tocompress 
+  Makes haproxy able to compress both requests and responses.
+  Valid values are "request", to compress only requests, "response", to
+  compress only responses, or "both", when you want to compress both.
+  The default value is "response".
+
+  See also : "compression type", "compression algo", "compression offload"
 
 cookie  [ rewrite | insert | prefix ] [ indirect ] [ nocache ]
   [ postonly ] [ preserve ] [ httponly ] [ secure ]
diff --git a/include/haproxy/compression-t.h b/include/haproxy/compression-t.h
index cdbf0d14e..d15d15ee3 100644
--- a/include/haproxy/compression-t.h
+++ b/include/haproxy/compression-t.h
@@ -37,6 +37,9 @@
 /* Compression flags */
 
 #define COMP_FL_OFFLOAD		0x0001 /* Compression offload */
+#define COMP_FL_COMPRESS_REQ	0x0002 /* Compress requests */
+#define COMP_FL_COMPRESS_RES	0x0004 /* Compress responses */
+
 struct comp {
 	struct comp_algo *algos;
 	struct comp_type *types;
diff --git a/src/flt_http_comp.c b/src/flt_http_comp.c
index 507009692..7680e241f 100644
--- a/src/flt_http_comp.c
+++ b/src/flt_http_comp.c
@@ -33,7 +33,9 @@ struct flt_ops 

RE: Don't miss these great deals - RSA Conference 2023

2023-04-03 Thread Teresa Turner

Greeting!!

Can you let me know your interest in my below email?

If you would like to know more details about this reply with, "Send pricing 
info".

Awaiting your reply.

Thanks,

From: Teresa Turner
Sent: Wednesday, March 29, 2023 1:31 PM
To: 'haproxy@formilux.org' 
Subject: RE: Don't miss these great deals - RSA Conference 2023


Good day,

Just reply 'YES' if you'd be interested in getting some more information and 
I'll send you the counts & more details.

Awaiting your reply.

Sincerely,

From: Teresa Turner
Sent: Tuesday, March 28, 2023 1:45 PM
To: haproxy@formilux.org
Subject: Don't miss these great deals - RSA Conference 2023

Have A nice day,

RSA Conference 2023 pre-registered attendee contacts are available now.

We are providing you with the complete Attendees list at Discounted Price and 
pitching your proposal directly to your peers via an email campaign.

We are providing:- (Contact name, Company name, Job Title, Company Mailing 
address with Zip Code, Phone Number, Fax Number, SIC Code, Industry 
Classification, Website URL, and contact person verified business email address 
and LinkedIn Profile)

If you are interested to acquire the contacts, please reply "Yes - interested" 
so that I can share the details for your reference.

Regards,
Teresa Turner | Marketing Coordinator
If you do not wish to hear from us again, please respond with "Leave Out" and 
we will honor your request.






RE: Show Guide

2023-04-03 Thread Sophia Grace
Good Day,

Shall I send you the Pricing, Counts, & other details to acquire this list?

Best Regards,


_
From: Sophia Grace
Sent: 31 March 2023 17:21
To: haproxy@formilux.org
Subject: Show Guide
Importance: High


Hello,

This is Sophia,

Wanted to see what your goals were for this upcoming "RSA Conference Expo 2023" 
Noticing that marketers are increasingly looking for a new way to engage buyers.

With our list, you can Schedule meetings to talk about your products and 
solutions with current customers and new prospects with direct phone numbers or 
email.

If Yes please do let me know so I can send you more details.

Thanks & Best Regards,
Sophia Grace
Sr. Event Co-ordinator - RSA Conference Expo