diff options
author | Mark D. Roth <roth@google.com> | 2016-04-29 10:25:27 -0700 |
---|---|---|
committer | Mark D. Roth <roth@google.com> | 2016-04-29 10:25:27 -0700 |
commit | c2de452309c91b934382c2ea77eff5d9e53caad1 (patch) | |
tree | 425933b27388bd4e8de1259af1bae9aeb5d86dc6 /src/core/lib | |
parent | 0c6070f68d5dbac069fd19e1ddc394c2ea3c4775 (diff) |
Fix header-size computation to comply with the HTTP/2 RFC.
Diffstat (limited to 'src/core/lib')
-rw-r--r-- | src/core/lib/transport/metadata.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/lib/transport/metadata.h b/src/core/lib/transport/metadata.h index 277c257933..77c32c72de 100644 --- a/src/core/lib/transport/metadata.h +++ b/src/core/lib/transport/metadata.h @@ -146,8 +146,10 @@ void grpc_mdelem_unref(grpc_mdelem *md); const char *grpc_mdstr_as_c_string(grpc_mdstr *s); #define GRPC_MDSTR_LENGTH(s) (GPR_SLICE_LENGTH(s->slice)) + +/* We add 32 bytes of padding as per RFC-7540 section 6.5.2. */ #define GRPC_MDELEM_LENGTH(e) (GRPC_MDSTR_LENGTH(e->key) + \ - GRPC_MDSTR_LENGTH(e->value)) + GRPC_MDSTR_LENGTH(e->value) + 32) int grpc_mdstr_is_legal_header(grpc_mdstr *s); int grpc_mdstr_is_legal_nonbin_header(grpc_mdstr *s); |