From 0a5bcbc63273de042fd4a211b2154caacf8e3b59 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 9 Feb 2015 21:39:04 -0800 Subject: [PATCH 1/3] Add some documentation --- include/grpc/grpc.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/grpc/grpc.h b/include/grpc/grpc.h index 982cd3b43e1..7b33a4d8619 100644 --- a/include/grpc/grpc.h +++ b/include/grpc/grpc.h @@ -330,6 +330,8 @@ typedef struct grpc_op { size_t *status_details_capacity; } recv_status_on_client; struct { + /* out argument, set to 1 if the call failed in any way (seen as a cancellation + on the server), or 0 if the call succeeded */ int *cancelled; } recv_close_on_server; } data; From 9b2a531781ed785dc28d20441ffdb8cc5619711b Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 10 Feb 2015 09:19:47 -0800 Subject: [PATCH 2/3] Correctly handle large headers in HPACK table I missed a clause in section 4.4 of the HPACK spec when implementing this stuff. Removes an errant assert and correctly handles adding large entries to the HPACK table by flushing it and leaving it empty. --- src/core/transport/chttp2/hpack_table.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/core/transport/chttp2/hpack_table.c b/src/core/transport/chttp2/hpack_table.c index 1b944232d86..f5c10f934bf 100644 --- a/src/core/transport/chttp2/hpack_table.c +++ b/src/core/transport/chttp2/hpack_table.c @@ -164,7 +164,21 @@ void grpc_chttp2_hptbl_add(grpc_chttp2_hptbl *tbl, grpc_mdelem *md) { GRPC_CHTTP2_HPACK_ENTRY_OVERHEAD; /* we can't add elements bigger than the max table size */ - assert(elem_bytes <= tbl->max_bytes); + if (elem_bytes > tbl->max_bytes) { + /* HPACK draft 10 section 4.4 states: + * If the size of the new entry is less than or equal to the maximum + * size, that entry is added to the table. It is not an error to + * attempt to add an entry that is larger than the maximum size; an + * attempt to add an entry larger than the entire table causes + * the table + * to be emptied of all existing entries, and results in an + * empty table. + */ + while (tbl->num_ents) { + evict1(tbl); + } + return; + } /* evict entries to ensure no overflow */ while (elem_bytes > tbl->max_bytes - tbl->mem_used) { From 0a8acd406793e15abecefc95bc88fbb21983108c Mon Sep 17 00:00:00 2001 From: Jayant Kolhe Date: Tue, 10 Feb 2015 09:30:14 -0800 Subject: [PATCH 3/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 95825f69902..99e19db337b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[gRPC - An RPC library and framework](http://github.com/google/grpc) +[gRPC - An RPC library and framework](http://github.com/grpc/grpc) =================================== Copyright 2015 Google Inc.