BUG/MEDIUM: http/htx: Fix handling of the option abortonclose

Because the flag CF_SHUTR is no more set to mark the end of the message by the
H2 multiplexer, we can rely on it again to detect aborts. there is no more need
to make a check on the flag SI_FL_CLEAN_ABRT when the option abortonclose is
enabled. So, this option should work as before for h2 clients.

This patch must be backported to 1.9 with the previous EOI patches.
diff --git a/src/proto_http.c b/src/proto_http.c
index a1bcbb9..0a91091 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -1777,7 +1777,6 @@
 		case ACT_CUSTOM:
 			if ((s->req.flags & CF_READ_ERROR) ||
 			    ((s->req.flags & (CF_SHUTR|CF_READ_NULL)) &&
-			     !(s->si[0].flags & SI_FL_CLEAN_ABRT) &&
 			     (px->options & PR_O_ABRT_CLOSE)))
 				act_flags |= ACT_FLAG_FINAL;
 
@@ -2184,7 +2183,6 @@
 		case ACT_CUSTOM:
 			if ((s->req.flags & CF_READ_ERROR) ||
 			    ((s->req.flags & (CF_SHUTR|CF_READ_NULL)) &&
-			     !(s->si[0].flags & SI_FL_CLEAN_ABRT) &&
 			     (px->options & PR_O_ABRT_CLOSE)))
 				act_flags |= ACT_FLAG_FINAL;
 
@@ -3612,8 +3610,7 @@
 		 */
 		if (((txn->flags & TX_CON_WANT_MSK) != TX_CON_WANT_SCL) &&
 		    ((txn->flags & TX_CON_WANT_MSK) != TX_CON_WANT_KAL) &&
-		    (!(s->be->options & PR_O_ABRT_CLOSE) ||
-		     (s->si[0].flags & SI_FL_CLEAN_ABRT)) &&
+		    !(s->be->options & PR_O_ABRT_CLOSE) &&
 		    txn->meth != HTTP_METH_POST)
 			channel_dont_read(chn);
 
@@ -3708,8 +3705,7 @@
 		/* see above in MSG_DONE why we only do this in these states */
 		if (((txn->flags & TX_CON_WANT_MSK) != TX_CON_WANT_SCL) &&
 		    ((txn->flags & TX_CON_WANT_MSK) != TX_CON_WANT_KAL) &&
-		    (!(s->be->options & PR_O_ABRT_CLOSE) ||
-		     (s->si[0].flags & SI_FL_CLEAN_ABRT)))
+		    !(s->be->options & PR_O_ABRT_CLOSE))
 			channel_dont_read(chn);
 		goto wait_other_side;
 	}
@@ -4070,7 +4066,7 @@
 	 * server, which will decide whether to close or to go on processing the
 	 * request. We only do that in tunnel mode, and not in other modes since
 	 * it can be abused to exhaust source ports. */
-	if ((s->be->options & PR_O_ABRT_CLOSE) && !(s->si[0].flags & SI_FL_CLEAN_ABRT)) {
+	if (s->be->options & PR_O_ABRT_CLOSE) {
 		channel_auto_read(req);
 		if ((req->flags & (CF_SHUTR|CF_READ_NULL)) &&
 		    ((txn->flags & TX_CON_WANT_MSK) != TX_CON_WANT_TUN))
diff --git a/src/proto_htx.c b/src/proto_htx.c
index bdfd4ba..d6144fb 100644
--- a/src/proto_htx.c
+++ b/src/proto_htx.c
@@ -1285,7 +1285,7 @@
 	 * server, which will decide whether to close or to go on processing the
 	 * request. We only do that in tunnel mode, and not in other modes since
 	 * it can be abused to exhaust source ports. */
-	if ((s->be->options & PR_O_ABRT_CLOSE) && !(s->si[0].flags & SI_FL_CLEAN_ABRT)) {
+	if (s->be->options & PR_O_ABRT_CLOSE) {
 		channel_auto_read(req);
 		if ((req->flags & (CF_SHUTR|CF_READ_NULL)) &&
 		    ((txn->flags & TX_CON_WANT_MSK) != TX_CON_WANT_TUN))
@@ -3012,7 +3012,6 @@
 			case ACT_CUSTOM:
 				if ((s->req.flags & CF_READ_ERROR) ||
 				    ((s->req.flags & (CF_SHUTR|CF_READ_NULL)) &&
-				     !(s->si[0].flags & SI_FL_CLEAN_ABRT) &&
 				     (px->options & PR_O_ABRT_CLOSE)))
 					act_flags |= ACT_FLAG_FINAL;
 
@@ -3402,7 +3401,6 @@
 			case ACT_CUSTOM:
 				if ((s->req.flags & CF_READ_ERROR) ||
 				    ((s->req.flags & (CF_SHUTR|CF_READ_NULL)) &&
-				     !(s->si[0].flags & SI_FL_CLEAN_ABRT) &&
 				     (px->options & PR_O_ABRT_CLOSE)))
 					act_flags |= ACT_FLAG_FINAL;
 
@@ -5055,8 +5053,7 @@
 		 * buffers, otherwise a close could cause an RST on some systems
 		 * (eg: Linux).
 		 */
-		if ((!(s->be->options & PR_O_ABRT_CLOSE) || (s->si[0].flags & SI_FL_CLEAN_ABRT)) &&
-		    txn->meth != HTTP_METH_POST)
+		if (!(s->be->options & PR_O_ABRT_CLOSE) && txn->meth != HTTP_METH_POST)
 			channel_dont_read(chn);
 
 		/* if the server closes the connection, we want to immediately react
@@ -5136,7 +5133,7 @@
 		if (txn->rsp.flags & HTTP_MSGF_XFER_LEN)
 			s->si[1].flags |= SI_FL_NOLINGER;  /* we want to close ASAP */
 		/* see above in MSG_DONE why we only do this in these states */
-		if ((!(s->be->options & PR_O_ABRT_CLOSE) || (s->si[0].flags & SI_FL_CLEAN_ABRT)))
+		if (!(s->be->options & PR_O_ABRT_CLOSE))
 			channel_dont_read(chn);
 		goto end;
 	}
diff --git a/src/stream.c b/src/stream.c
index d4cda4b..25618ae 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -670,7 +670,7 @@
 	    unlikely((rep->flags & CF_SHUTW) ||
 		     ((req->flags & CF_SHUTW_NOW) && /* FIXME: this should not prevent a connection from establishing */
 		      ((!(req->flags & CF_WRITE_ACTIVITY) && channel_is_empty(req)) ||
-		       ((s->be->options & PR_O_ABRT_CLOSE) && !(s->si[0].flags & SI_FL_CLEAN_ABRT)))))) {
+		       (s->be->options & PR_O_ABRT_CLOSE))))) {
 		/* give up */
 		si_shutw(si);
 		si->err_type |= SI_ET_CONN_ABRT;
@@ -890,8 +890,7 @@
 {
 	return ((req->flags & (CF_READ_ERROR)) ||
 	        ((req->flags & (CF_SHUTW_NOW|CF_SHUTW)) &&  /* empty and client aborted */
-	         (channel_is_empty(req) ||
-		  ((s->be->options & PR_O_ABRT_CLOSE) && !(s->si[0].flags & SI_FL_CLEAN_ABRT)))));
+	         (channel_is_empty(req) || (s->be->options & PR_O_ABRT_CLOSE))));
 }
 
 /* Update back stream interface status for input states SI_ST_ASS, SI_ST_QUE,