[MEDIUM] do not add Connection: close in HTTP/1.0 mode

If we already are in HTTP/1.0 and if no connection: has been seen,
it is not necessary to add Connection: close.
diff --git a/src/proto_http.c b/src/proto_http.c
index d0eeb56..6728eb3 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -1695,10 +1695,13 @@
 
 		/*
 		 * 10: add "Connection: close" if needed and not yet set.
+		 * Note that we do not need to add it in case of HTTP/1.0.
 		 */
-		if (((t->fe->options | t->be->beprm->options) & PR_O_HTTP_CLOSE) &&
-		    !(t->flags & SN_CONN_CLOSED)) {
-			if (unlikely(http_header_add_tail2(req, &txn->req, &txn->hdr_idx,
+		if (!(t->flags & SN_CONN_CLOSED) &&
+		    ((t->fe->options | t->be->beprm->options) & PR_O_HTTP_CLOSE)) {
+			if ((unlikely(msg->sl.rq.v_l != 8) ||
+			     unlikely(req->data[msg->som + msg->sl.rq.v + 7] != '0')) &&
+			    unlikely(http_header_add_tail2(req, &txn->req, &txn->hdr_idx,
 							   "Connection: close", 17)) < 0)
 				goto return_bad_req;
 			t->flags |= SN_CONN_CLOSED;
@@ -2737,10 +2740,13 @@
 
 		/*
 		 * 8: add "Connection: close" if needed and not yet set.
+		 * Note that we do not need to add it in case of HTTP/1.0.
 		 */
-		if (((t->fe->options | t->be->beprm->options) & PR_O_HTTP_CLOSE) &&
-		    !(t->flags & SN_CONN_CLOSED)) {
-			if (unlikely(http_header_add_tail2(rep, &txn->rsp, &txn->hdr_idx,
+		if (!(t->flags & SN_CONN_CLOSED) &&
+		    ((t->fe->options | t->be->beprm->options) & PR_O_HTTP_CLOSE)) {
+			if ((unlikely(msg->sl.st.v_l != 8) ||
+			     unlikely(req->data[msg->som + 7] != '0')) &&
+			    unlikely(http_header_add_tail2(rep, &txn->rsp, &txn->hdr_idx,
 							   "Connection: close", 17)) < 0)
 				goto return_bad_resp;
 			t->flags |= SN_CONN_CLOSED;