]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: early data: Never remove the CO_FL_EARLY_DATA flag.
authorOlivier Houchard <ohouchard@haproxy.com>
Wed, 29 Nov 2017 18:51:19 +0000 (19:51 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 5 Feb 2018 13:24:50 +0000 (14:24 +0100)
It may be useful to keep the CO_FL_EARLY_DATA flag, so that we know early
data were used, so instead of doing this, only add the Early-data header,
and have the sample fetch ssl_fc_has_early return 1, if CO_FL_EARLY_DATA is
set, and if the handshake isn't done yet.

src/proto_http.c
src/ssl_sock.c

index 699017619499c1b79095e1cb50899e0b82b20c61..5fb510f8dbef07db37b26a30ad5a495557007028 100644 (file)
@@ -3446,7 +3446,8 @@ int http_process_req_common(struct stream *s, struct channel *req, int an_bit, s
                }
        }
 
-       if (conn && conn->flags & CO_FL_EARLY_DATA) {
+       if (conn && (conn->flags & CO_FL_EARLY_DATA) &&
+           (conn->flags & (CO_FL_EARLY_SSL_HS | CO_FL_HANDSHAKE))) {
                struct hdr_ctx ctx;
 
                ctx.idx = 0;
index 76f842528b42af42033875afdea6730edbbd682d..aee3cd9655ba3d47fa260153c90b6c5b091a0323 100644 (file)
@@ -6025,7 +6025,8 @@ smp_fetch_ssl_fc_has_early(const struct arg *args, struct sample *smp, const cha
 
        smp->flags = 0;
        smp->data.type = SMP_T_BOOL;
-       smp->data.u.sint = (conn->flags & CO_FL_EARLY_DATA) ? 1 : 0;
+       smp->data.u.sint = ((conn->flags & CO_FL_EARLY_DATA)  &&
+           (conn->flags & (CO_FL_EARLY_SSL_HS | CO_FL_HANDSHAKE))) ? 1 : 0;
 
        return 1;
 }