MINOR: compression: automatically disable compression for older browsers

A number of older browsers have many issues with compressed contents. It
happens that all these older browsers announce themselves as "Mozilla/4"
and that despite not being all broken, the amount of working browsers
announcing themselves this way compared to all other ones is so tiny
that it's not worth wasting cycles trying to adapt to every specific
one.

So let's simply disable compression for these older browsers.

More information on this very detailed article :

   http://zoompf.com/2012/02/lose-the-wait-http-compression
diff --git a/src/proto_http.c b/src/proto_http.c
index 720d66b..9b094d7 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -1970,14 +1970,25 @@
 
 /*
  * Selects a compression algorithm depending on the client request.
-*/
-
+ */
 int select_compression_request_header(struct session *s, struct buffer *req)
 {
 	struct http_txn *txn = &s->txn;
 	struct hdr_ctx ctx;
 	struct comp_algo *comp_algo = NULL;
 
+	/* Disable compression for older user agents announcing themselves as "Mozilla/4".
+	 * Note all of them are broken but they are very few and the broken ones are there.
+	 * See http://zoompf.com/2012/02/lose-the-wait-http-compression for more details.
+	 */
+	ctx.idx = 0;
+	if (http_find_header2("User-Agent", 10, req->p, &txn->hdr_idx, &ctx) &&
+	    ctx.vlen >= 9 &&
+	    memcmp(ctx.line + ctx.val, "Mozilla/4", 9) == 0) {
+		s->comp_algo = NULL;
+		return 0;
+	}
+
 	ctx.idx = 0;
 	/* no compression when Cache-Control: no-transform found */
 	while (http_find_header2("Cache-Control", 13, req->p, &txn->hdr_idx, &ctx)) {