Fix character classes to updated spec

pull/3021/head
Craig Tiller 9 years ago
parent 49772e00eb
commit 80aa28013f
  1. 6
      src/core/transport/metadata.c
  2. 2
      tools/codegen/core/gen_legal_metadata_characters.c

@ -695,11 +695,9 @@ static int conforms_to(grpc_mdstr *s, const gpr_uint8 *legal_bits) {
int grpc_mdstr_is_legal_header(grpc_mdstr *s) {
static const gpr_uint8 legal_header_bits[256 / 8] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xff, 0x03, 0xfe, 0xff, 0xff,
0x07, 0xfe, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xff, 0x03, 0x00, 0x00, 0x00,
0x80, 0xfe, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
/* TODO(ctiller): consider caching this, or computing it on construction */
return conforms_to(s, legal_header_bits);
}

@ -60,9 +60,9 @@ int main(void) {
clear();
for (i = 'a'; i <= 'z'; i++) legal(i);
for (i = 'A'; i <= 'Z'; i++) legal(i);
for (i = '0'; i <= '9'; i++) legal(i);
legal('-');
legal('_');
dump();
clear();

Loading…
Cancel
Save