grpc 1.39.0.pre1 → 1.40.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of grpc might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Makefile +34 -18
- data/include/grpc/event_engine/event_engine.h +10 -14
- data/include/grpc/event_engine/slice_allocator.h +8 -33
- data/include/grpc/impl/codegen/grpc_types.h +18 -8
- data/include/grpc/impl/codegen/port_platform.h +24 -0
- data/src/core/ext/filters/client_channel/client_channel.cc +413 -247
- data/src/core/ext/filters/client_channel/client_channel.h +42 -18
- data/src/core/ext/filters/client_channel/config_selector.h +19 -6
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +7 -8
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +12 -21
- data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +3 -5
- data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +17 -38
- data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +8 -15
- data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +3 -6
- data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +8 -12
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc +14 -22
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc +2 -9
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +5 -8
- data/src/core/ext/filters/client_channel/lb_policy.cc +1 -15
- data/src/core/ext/filters/client_channel/lb_policy.h +70 -46
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +101 -73
- data/src/core/ext/filters/client_channel/retry_filter.cc +392 -243
- data/src/core/ext/filters/client_channel/retry_service_config.cc +36 -26
- data/src/core/ext/filters/client_channel/retry_service_config.h +1 -1
- data/src/core/ext/filters/client_channel/service_config_call_data.h +45 -5
- data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +0 -6
- data/src/core/ext/filters/http/client/http_client_filter.cc +5 -2
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +5 -1
- data/src/core/ext/transport/chttp2/transport/bin_decoder.cc +1 -1
- data/src/core/{lib/event_engine/slice_allocator.cc → ext/transport/chttp2/transport/chttp2_slice_allocator.cc} +15 -38
- data/src/core/ext/transport/chttp2/transport/chttp2_slice_allocator.h +74 -0
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +2 -6
- data/src/core/ext/transport/chttp2/transport/flow_control.h +1 -1
- data/src/core/ext/transport/chttp2/transport/frame_data.cc +4 -4
- data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +8 -8
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +5 -5
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +639 -752
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +190 -69
- data/src/core/ext/transport/chttp2/transport/internal.h +1 -1
- data/src/core/ext/transport/chttp2/transport/parsing.cc +70 -54
- data/src/core/ext/transport/chttp2/transport/varint.cc +6 -4
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c +56 -35
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h +180 -76
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c +35 -27
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h +97 -48
- data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c +45 -9
- data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h +67 -7
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c +66 -9
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h +227 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c +46 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h +121 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c +1 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c +35 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h +90 -0
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c +32 -24
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h +120 -73
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c +4 -2
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h +15 -0
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c +48 -0
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h +171 -0
- data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c +8 -6
- data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h +27 -19
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c +1 -0
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c +24 -7
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h +57 -0
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c +29 -17
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h +72 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c +3 -2
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h +4 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c +6 -5
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h +15 -11
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c +85 -43
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +274 -91
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c +11 -8
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h +30 -13
- data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c +33 -5
- data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h +115 -0
- data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c +60 -0
- data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h +181 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c +1 -0
- data/src/core/ext/upb-generated/validate/validate.upb.c +82 -66
- data/src/core/ext/upb-generated/validate/validate.upb.h +220 -124
- data/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c +15 -7
- data/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c +53 -52
- data/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c +318 -277
- data/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c +437 -410
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c +198 -170
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h +10 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c +9 -8
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c +219 -163
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h +15 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c +59 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c +29 -25
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c +52 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c +135 -125
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c +131 -123
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c +90 -0
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c +32 -24
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c +69 -55
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c +684 -664
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c +13 -10
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c +13 -10
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +441 -375
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h +10 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c +122 -114
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c +1 -1
- data/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c +112 -79
- data/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c +64 -0
- data/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.h +50 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c +35 -32
- data/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c +4 -4
- data/src/core/ext/upbdefs-generated/validate/validate.upbdefs.c +182 -160
- data/src/core/ext/xds/certificate_provider_store.h +1 -1
- data/src/core/ext/xds/xds_api.cc +320 -121
- data/src/core/ext/xds/xds_api.h +31 -2
- data/src/core/ext/xds/xds_bootstrap.cc +4 -1
- data/src/core/ext/xds/xds_client.cc +66 -43
- data/src/core/ext/xds/xds_client.h +0 -4
- data/src/core/ext/xds/xds_http_filters.cc +3 -2
- data/src/core/ext/xds/xds_http_filters.h +3 -0
- data/src/core/lib/channel/call_tracer.h +85 -0
- data/src/core/lib/channel/channel_stack.h +1 -1
- data/src/core/lib/channel/context.h +3 -0
- data/src/core/lib/channel/status_util.h +4 -0
- data/src/core/lib/compression/stream_compression.h +1 -1
- data/src/core/lib/compression/stream_compression_gzip.h +1 -1
- data/src/core/lib/compression/stream_compression_identity.h +1 -1
- data/src/core/lib/debug/stats.h +1 -1
- data/src/core/lib/gpr/murmur_hash.cc +4 -2
- data/src/core/lib/gprpp/manual_constructor.h +1 -1
- data/src/core/lib/gprpp/orphanable.h +3 -3
- data/src/core/lib/gprpp/sync.h +2 -30
- data/src/core/lib/iomgr/buffer_list.cc +1 -1
- data/src/core/lib/iomgr/ev_apple.h +1 -1
- data/src/core/lib/iomgr/event_engine/endpoint.cc +6 -8
- data/src/core/lib/iomgr/event_engine/tcp.cc +30 -10
- data/src/core/lib/iomgr/python_util.h +1 -1
- data/src/core/lib/iomgr/resource_quota.cc +2 -0
- data/src/core/lib/iomgr/tcp_client_windows.cc +2 -0
- data/src/core/lib/iomgr/tcp_server_posix.cc +1 -0
- data/src/core/lib/iomgr/timer_manager.cc +1 -1
- data/src/core/lib/json/json_reader.cc +1 -2
- data/src/core/lib/matchers/matchers.cc +8 -20
- data/src/core/lib/matchers/matchers.h +2 -1
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +49 -0
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h +7 -0
- data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +6 -18
- data/src/core/lib/security/transport/security_handshaker.cc +12 -4
- data/src/core/lib/security/transport/server_auth_filter.cc +0 -7
- data/src/core/lib/slice/slice_internal.h +1 -0
- data/src/core/lib/surface/call.cc +5 -6
- data/src/core/lib/surface/server.cc +3 -1
- data/src/core/lib/surface/server.h +3 -3
- data/src/core/lib/surface/version.cc +2 -4
- data/src/ruby/ext/grpc/extconf.rb +1 -1
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/third_party/xxhash/xxhash.h +77 -195
- metadata +57 -40
- data/src/core/lib/gpr/arena.h +0 -47
@@ -27,84 +27,205 @@
|
|
27
27
|
#include "src/core/ext/transport/chttp2/transport/hpack_table.h"
|
28
28
|
#include "src/core/lib/transport/metadata.h"
|
29
29
|
|
30
|
-
|
30
|
+
namespace grpc_core {
|
31
31
|
|
32
|
-
|
33
|
-
|
32
|
+
class HPackParser {
|
33
|
+
public:
|
34
|
+
enum class Boundary { None, EndOfHeaders, EndOfStream };
|
35
|
+
enum class Priority { None, Included };
|
34
36
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
37
|
+
// User specified structure called for each received header.
|
38
|
+
using Sink = std::function<grpc_error_handle(grpc_mdelem)>;
|
39
|
+
|
40
|
+
HPackParser();
|
41
|
+
~HPackParser();
|
42
|
+
|
43
|
+
HPackParser(const HPackParser&) = delete;
|
44
|
+
HPackParser& operator=(const HPackParser&) = delete;
|
45
|
+
|
46
|
+
void BeginFrame(Sink sink, Boundary boundary, Priority priority);
|
47
|
+
void ResetSink(Sink sink) { sink_ = std::move(sink); }
|
48
|
+
grpc_error_handle Parse(const grpc_slice& slice);
|
49
|
+
void FinishFrame();
|
50
|
+
|
51
|
+
grpc_chttp2_hptbl* hpack_table() { return &table_; }
|
52
|
+
bool is_boundary() const { return boundary_ != Boundary::None; }
|
53
|
+
bool is_eof() const { return boundary_ == Boundary::EndOfStream; }
|
54
|
+
bool is_in_begin_state() const { return state_ == &HPackParser::parse_begin; }
|
55
|
+
|
56
|
+
private:
|
57
|
+
enum class BinaryState {
|
58
|
+
kNotBinary,
|
59
|
+
kBinaryBegin,
|
60
|
+
kBase64Byte0,
|
61
|
+
kBase64Byte1,
|
62
|
+
kBase64Byte2,
|
63
|
+
kBase64Byte3,
|
64
|
+
};
|
65
|
+
|
66
|
+
struct String {
|
67
|
+
bool copied_;
|
39
68
|
struct {
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
};
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
69
|
+
grpc_slice referenced;
|
70
|
+
struct {
|
71
|
+
char* str;
|
72
|
+
uint32_t length;
|
73
|
+
uint32_t capacity;
|
74
|
+
} copied;
|
75
|
+
} data_;
|
76
|
+
|
77
|
+
UnmanagedMemorySlice TakeExtern();
|
78
|
+
ManagedMemorySlice TakeIntern();
|
79
|
+
void AppendBytes(const uint8_t* data, size_t length);
|
80
|
+
};
|
81
|
+
|
82
|
+
using State = grpc_error_handle (HPackParser::*)(const uint8_t* beg,
|
83
|
+
const uint8_t* end);
|
84
|
+
|
85
|
+
// Forward declarations for parsing states.
|
86
|
+
// These are keeping their old (C-style) names until a future refactor where
|
87
|
+
// they will be eliminated.
|
88
|
+
grpc_error_handle parse_next(const uint8_t* cur, const uint8_t* end);
|
89
|
+
grpc_error_handle parse_begin(const uint8_t* cur, const uint8_t* end);
|
90
|
+
grpc_error_handle parse_error(const uint8_t* cur, const uint8_t* end,
|
91
|
+
grpc_error_handle error);
|
92
|
+
grpc_error_handle still_parse_error(const uint8_t* cur, const uint8_t* end);
|
93
|
+
grpc_error_handle parse_illegal_op(const uint8_t* cur, const uint8_t* end);
|
94
|
+
|
95
|
+
grpc_error_handle parse_string_prefix(const uint8_t* cur, const uint8_t* end);
|
96
|
+
grpc_error_handle parse_key_string(const uint8_t* cur, const uint8_t* end);
|
97
|
+
grpc_error_handle parse_value_string(const uint8_t* cur, const uint8_t* end,
|
98
|
+
bool is_binary);
|
99
|
+
grpc_error_handle parse_value_string_with_indexed_key(const uint8_t* cur,
|
100
|
+
const uint8_t* end);
|
101
|
+
grpc_error_handle parse_value_string_with_literal_key(const uint8_t* cur,
|
102
|
+
const uint8_t* end);
|
103
|
+
grpc_error_handle parse_stream_weight(const uint8_t* cur, const uint8_t* end);
|
104
|
+
grpc_error_handle parse_value0(const uint8_t* cur, const uint8_t* end);
|
105
|
+
grpc_error_handle parse_value1(const uint8_t* cur, const uint8_t* end);
|
106
|
+
grpc_error_handle parse_value2(const uint8_t* cur, const uint8_t* end);
|
107
|
+
grpc_error_handle parse_value3(const uint8_t* cur, const uint8_t* end);
|
108
|
+
grpc_error_handle parse_value4(const uint8_t* cur, const uint8_t* end);
|
109
|
+
grpc_error_handle parse_value5up(const uint8_t* cur, const uint8_t* end);
|
110
|
+
grpc_error_handle parse_stream_dep0(const uint8_t* cur, const uint8_t* end);
|
111
|
+
grpc_error_handle parse_stream_dep1(const uint8_t* cur, const uint8_t* end);
|
112
|
+
grpc_error_handle parse_stream_dep2(const uint8_t* cur, const uint8_t* end);
|
113
|
+
grpc_error_handle parse_stream_dep3(const uint8_t* cur, const uint8_t* end);
|
114
|
+
|
115
|
+
grpc_error_handle parse_indexed_field(const uint8_t* cur, const uint8_t* end);
|
116
|
+
grpc_error_handle parse_indexed_field_x(const uint8_t* cur,
|
117
|
+
const uint8_t* end);
|
118
|
+
grpc_error_handle parse_lithdr_incidx(const uint8_t* cur, const uint8_t* end);
|
119
|
+
grpc_error_handle parse_lithdr_incidx_x(const uint8_t* cur,
|
120
|
+
const uint8_t* end);
|
121
|
+
grpc_error_handle parse_lithdr_incidx_v(const uint8_t* cur,
|
122
|
+
const uint8_t* end);
|
123
|
+
grpc_error_handle parse_lithdr_notidx(const uint8_t* cur, const uint8_t* end);
|
124
|
+
grpc_error_handle parse_lithdr_notidx_x(const uint8_t* cur,
|
125
|
+
const uint8_t* end);
|
126
|
+
grpc_error_handle parse_lithdr_notidx_v(const uint8_t* cur,
|
127
|
+
const uint8_t* end);
|
128
|
+
grpc_error_handle parse_lithdr_nvridx(const uint8_t* cur, const uint8_t* end);
|
129
|
+
grpc_error_handle parse_lithdr_nvridx_x(const uint8_t* cur,
|
130
|
+
const uint8_t* end);
|
131
|
+
grpc_error_handle parse_lithdr_nvridx_v(const uint8_t* cur,
|
132
|
+
const uint8_t* end);
|
133
|
+
grpc_error_handle parse_max_tbl_size(const uint8_t* cur, const uint8_t* end);
|
134
|
+
grpc_error_handle parse_max_tbl_size_x(const uint8_t* cur,
|
135
|
+
const uint8_t* end);
|
136
|
+
grpc_error_handle parse_string(const uint8_t* cur, const uint8_t* end);
|
137
|
+
grpc_error_handle begin_parse_string(const uint8_t* cur, const uint8_t* end,
|
138
|
+
BinaryState binary, String* str);
|
139
|
+
|
140
|
+
grpc_error_handle finish_indexed_field(const uint8_t* cur,
|
141
|
+
const uint8_t* end);
|
142
|
+
grpc_error_handle finish_lithdr_incidx(const uint8_t* cur,
|
143
|
+
const uint8_t* end);
|
144
|
+
grpc_error_handle finish_lithdr_incidx_v(const uint8_t* cur,
|
145
|
+
const uint8_t* end);
|
146
|
+
grpc_error_handle finish_lithdr_notidx(const uint8_t* cur,
|
147
|
+
const uint8_t* end);
|
148
|
+
grpc_error_handle finish_lithdr_notidx_v(const uint8_t* cur,
|
149
|
+
const uint8_t* end);
|
150
|
+
grpc_error_handle finish_lithdr_nvridx(const uint8_t* cur,
|
151
|
+
const uint8_t* end);
|
152
|
+
grpc_error_handle finish_lithdr_nvridx_v(const uint8_t* cur,
|
153
|
+
const uint8_t* end);
|
154
|
+
grpc_error_handle finish_max_tbl_size(const uint8_t* cur, const uint8_t* end);
|
155
|
+
grpc_error_handle finish_str(const uint8_t* cur, const uint8_t* end);
|
156
|
+
|
157
|
+
enum class TableAction {
|
158
|
+
kAddToTable,
|
159
|
+
kOmitFromTable,
|
160
|
+
};
|
161
|
+
|
162
|
+
GPR_ATTRIBUTE_NOINLINE grpc_error_handle InvalidHPackIndexError();
|
163
|
+
GPR_ATTRIBUTE_NOINLINE void LogHeader(grpc_mdelem md);
|
164
|
+
grpc_error_handle AddHeaderToTable(grpc_mdelem md);
|
165
|
+
template <TableAction table_action>
|
166
|
+
grpc_error_handle FinishHeader(grpc_mdelem md);
|
167
|
+
|
168
|
+
grpc_mdelem GetPrecomputedMDForIndex();
|
169
|
+
void SetPrecomputedMDIndex(grpc_mdelem md);
|
170
|
+
bool IsBinaryLiteralHeader();
|
171
|
+
grpc_error_handle IsBinaryIndexedHeader(bool* is);
|
172
|
+
|
173
|
+
grpc_error_handle AppendString(const uint8_t* cur, const uint8_t* end);
|
174
|
+
grpc_error_handle AppendHuffNibble(uint8_t nibble);
|
175
|
+
grpc_error_handle AppendHuffBytes(const uint8_t* cur, const uint8_t* end);
|
176
|
+
grpc_error_handle AppendStrBytes(const uint8_t* cur, const uint8_t* end);
|
177
|
+
|
178
|
+
Sink sink_;
|
179
|
+
grpc_error_handle last_error_;
|
180
|
+
|
181
|
+
// current parse state - or a function that implements it
|
182
|
+
State state_;
|
183
|
+
// future states dependent on the opening op code
|
184
|
+
const State* next_state_;
|
185
|
+
// what to do after skipping prioritization data
|
186
|
+
State after_prioritization_;
|
187
|
+
// the refcount of the slice that we're currently parsing
|
188
|
+
grpc_slice_refcount* current_slice_refcount_;
|
189
|
+
// the value we're currently parsing
|
62
190
|
union {
|
63
191
|
uint32_t* value;
|
64
|
-
|
65
|
-
}
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
uint32_t
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
grpc_mdelem
|
192
|
+
String* str;
|
193
|
+
} parsing_;
|
194
|
+
// string parameters for each chunk
|
195
|
+
String key_;
|
196
|
+
String value_;
|
197
|
+
// parsed index
|
198
|
+
uint32_t index_;
|
199
|
+
// When we parse a value string, we determine the metadata element for a
|
200
|
+
// specific index, which we need again when we're finishing up with that
|
201
|
+
// header. To avoid calculating the metadata element for that index a second
|
202
|
+
// time at that stage, we cache (and invalidate) the element here.
|
203
|
+
grpc_mdelem md_for_index_;
|
76
204
|
#ifndef NDEBUG
|
77
|
-
int64_t
|
205
|
+
int64_t precomputed_md_index_;
|
78
206
|
#endif
|
79
|
-
|
80
|
-
uint32_t
|
81
|
-
|
82
|
-
uint32_t
|
83
|
-
|
84
|
-
int16_t
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
uint8_t
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
uint32_t base64_buffer;
|
96
|
-
|
97
|
-
/* hpack table */
|
98
|
-
grpc_chttp2_hptbl table;
|
99
|
-
};
|
207
|
+
// length of source bytes for the currently parsing string
|
208
|
+
uint32_t strlen_;
|
209
|
+
// number of source bytes read for the currently parsing string
|
210
|
+
uint32_t strgot_;
|
211
|
+
// huffman decoding state
|
212
|
+
int16_t huff_state_;
|
213
|
+
// is the string being decoded binary?
|
214
|
+
BinaryState binary_;
|
215
|
+
// is the current string huffman encoded?
|
216
|
+
bool huff_;
|
217
|
+
// is a dynamic table update allowed?
|
218
|
+
uint8_t dynamic_table_updates_allowed_;
|
219
|
+
// set by higher layers, used by grpc_chttp2_header_parser_parse to signal
|
220
|
+
// it should append a metadata boundary at the end of frame
|
221
|
+
Boundary boundary_;
|
222
|
+
uint32_t base64_buffer_;
|
100
223
|
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
void grpc_chttp2_hpack_parser_set_has_priority(grpc_chttp2_hpack_parser* p);
|
224
|
+
// hpack table
|
225
|
+
grpc_chttp2_hptbl table_;
|
226
|
+
};
|
105
227
|
|
106
|
-
|
107
|
-
const grpc_slice& slice);
|
228
|
+
} // namespace grpc_core
|
108
229
|
|
109
230
|
/* wraps grpc_chttp2_hpack_parser_parse to provide a frame level parser for
|
110
231
|
the transport */
|
@@ -394,7 +394,7 @@ struct grpc_chttp2_transport {
|
|
394
394
|
grpc_chttp2_server_ping_recv_state ping_recv_state;
|
395
395
|
|
396
396
|
/** parser for headers */
|
397
|
-
|
397
|
+
grpc_core::HPackParser hpack_parser;
|
398
398
|
/** simple one shot parsers */
|
399
399
|
union {
|
400
400
|
grpc_chttp2_window_update_parser window_update;
|
@@ -36,6 +36,8 @@
|
|
36
36
|
#include "src/core/lib/transport/status_conversion.h"
|
37
37
|
#include "src/core/lib/transport/timeout_encoding.h"
|
38
38
|
|
39
|
+
using grpc_core::HPackParser;
|
40
|
+
|
39
41
|
static grpc_error_handle init_frame_parser(grpc_chttp2_transport* t);
|
40
42
|
static grpc_error_handle init_header_frame_parser(grpc_chttp2_transport* t,
|
41
43
|
int is_continuation);
|
@@ -46,8 +48,8 @@ static grpc_error_handle init_window_update_frame_parser(
|
|
46
48
|
grpc_chttp2_transport* t);
|
47
49
|
static grpc_error_handle init_ping_parser(grpc_chttp2_transport* t);
|
48
50
|
static grpc_error_handle init_goaway_parser(grpc_chttp2_transport* t);
|
49
|
-
static grpc_error_handle
|
50
|
-
|
51
|
+
static grpc_error_handle init_non_header_skip_frame_parser(
|
52
|
+
grpc_chttp2_transport* t);
|
51
53
|
|
52
54
|
static grpc_error_handle parse_frame_slice(grpc_chttp2_transport* t,
|
53
55
|
const grpc_slice& slice,
|
@@ -107,8 +109,8 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
|
|
107
109
|
if (cur == end) {
|
108
110
|
return GRPC_ERROR_NONE;
|
109
111
|
}
|
110
|
-
/* fallthrough */
|
111
112
|
dts_fh_0:
|
113
|
+
ABSL_FALLTHROUGH_INTENDED;
|
112
114
|
case GRPC_DTS_FH_0:
|
113
115
|
GPR_DEBUG_ASSERT(cur < end);
|
114
116
|
t->incoming_frame_size = (static_cast<uint32_t>(*cur)) << 16;
|
@@ -116,7 +118,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
|
|
116
118
|
t->deframe_state = GRPC_DTS_FH_1;
|
117
119
|
return GRPC_ERROR_NONE;
|
118
120
|
}
|
119
|
-
|
121
|
+
ABSL_FALLTHROUGH_INTENDED;
|
120
122
|
case GRPC_DTS_FH_1:
|
121
123
|
GPR_DEBUG_ASSERT(cur < end);
|
122
124
|
t->incoming_frame_size |= (static_cast<uint32_t>(*cur)) << 8;
|
@@ -124,7 +126,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
|
|
124
126
|
t->deframe_state = GRPC_DTS_FH_2;
|
125
127
|
return GRPC_ERROR_NONE;
|
126
128
|
}
|
127
|
-
|
129
|
+
ABSL_FALLTHROUGH_INTENDED;
|
128
130
|
case GRPC_DTS_FH_2:
|
129
131
|
GPR_DEBUG_ASSERT(cur < end);
|
130
132
|
t->incoming_frame_size |= *cur;
|
@@ -132,7 +134,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
|
|
132
134
|
t->deframe_state = GRPC_DTS_FH_3;
|
133
135
|
return GRPC_ERROR_NONE;
|
134
136
|
}
|
135
|
-
|
137
|
+
ABSL_FALLTHROUGH_INTENDED;
|
136
138
|
case GRPC_DTS_FH_3:
|
137
139
|
GPR_DEBUG_ASSERT(cur < end);
|
138
140
|
t->incoming_frame_type = *cur;
|
@@ -140,7 +142,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
|
|
140
142
|
t->deframe_state = GRPC_DTS_FH_4;
|
141
143
|
return GRPC_ERROR_NONE;
|
142
144
|
}
|
143
|
-
|
145
|
+
ABSL_FALLTHROUGH_INTENDED;
|
144
146
|
case GRPC_DTS_FH_4:
|
145
147
|
GPR_DEBUG_ASSERT(cur < end);
|
146
148
|
t->incoming_frame_flags = *cur;
|
@@ -148,7 +150,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
|
|
148
150
|
t->deframe_state = GRPC_DTS_FH_5;
|
149
151
|
return GRPC_ERROR_NONE;
|
150
152
|
}
|
151
|
-
|
153
|
+
ABSL_FALLTHROUGH_INTENDED;
|
152
154
|
case GRPC_DTS_FH_5:
|
153
155
|
GPR_DEBUG_ASSERT(cur < end);
|
154
156
|
t->incoming_stream_id = ((static_cast<uint32_t>(*cur)) & 0x7f) << 24;
|
@@ -156,7 +158,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
|
|
156
158
|
t->deframe_state = GRPC_DTS_FH_6;
|
157
159
|
return GRPC_ERROR_NONE;
|
158
160
|
}
|
159
|
-
|
161
|
+
ABSL_FALLTHROUGH_INTENDED;
|
160
162
|
case GRPC_DTS_FH_6:
|
161
163
|
GPR_DEBUG_ASSERT(cur < end);
|
162
164
|
t->incoming_stream_id |= (static_cast<uint32_t>(*cur)) << 16;
|
@@ -164,7 +166,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
|
|
164
166
|
t->deframe_state = GRPC_DTS_FH_7;
|
165
167
|
return GRPC_ERROR_NONE;
|
166
168
|
}
|
167
|
-
|
169
|
+
ABSL_FALLTHROUGH_INTENDED;
|
168
170
|
case GRPC_DTS_FH_7:
|
169
171
|
GPR_DEBUG_ASSERT(cur < end);
|
170
172
|
t->incoming_stream_id |= (static_cast<uint32_t>(*cur)) << 8;
|
@@ -172,7 +174,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
|
|
172
174
|
t->deframe_state = GRPC_DTS_FH_8;
|
173
175
|
return GRPC_ERROR_NONE;
|
174
176
|
}
|
175
|
-
|
177
|
+
ABSL_FALLTHROUGH_INTENDED;
|
176
178
|
case GRPC_DTS_FH_8:
|
177
179
|
GPR_DEBUG_ASSERT(cur < end);
|
178
180
|
t->incoming_stream_id |= (static_cast<uint32_t>(*cur));
|
@@ -206,7 +208,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
|
|
206
208
|
if (++cur == end) {
|
207
209
|
return GRPC_ERROR_NONE;
|
208
210
|
}
|
209
|
-
|
211
|
+
ABSL_FALLTHROUGH_INTENDED;
|
210
212
|
case GRPC_DTS_FRAME:
|
211
213
|
GPR_DEBUG_ASSERT(cur < end);
|
212
214
|
if (static_cast<uint32_t>(end - cur) == t->incoming_frame_size) {
|
@@ -301,7 +303,7 @@ static grpc_error_handle init_frame_parser(grpc_chttp2_transport* t) {
|
|
301
303
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
|
302
304
|
gpr_log(GPR_ERROR, "Unknown frame type %02x", t->incoming_frame_type);
|
303
305
|
}
|
304
|
-
return
|
306
|
+
return init_non_header_skip_frame_parser(t);
|
305
307
|
}
|
306
308
|
}
|
307
309
|
|
@@ -313,29 +315,46 @@ static grpc_error_handle skip_parser(void* /*parser*/,
|
|
313
315
|
return GRPC_ERROR_NONE;
|
314
316
|
}
|
315
317
|
|
316
|
-
|
318
|
+
grpc_error_handle skip_header(grpc_mdelem md) {
|
317
319
|
GRPC_MDELEM_UNREF(md);
|
318
320
|
return GRPC_ERROR_NONE;
|
319
321
|
}
|
320
322
|
|
321
|
-
static
|
322
|
-
|
323
|
-
if (
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
t->hpack_parser.is_boundary = is_eoh;
|
330
|
-
t->hpack_parser.is_eof = static_cast<uint8_t>(is_eoh ? t->header_eof : 0);
|
323
|
+
static HPackParser::Boundary hpack_boundary_type(grpc_chttp2_transport* t,
|
324
|
+
bool is_eoh) {
|
325
|
+
if (is_eoh) {
|
326
|
+
if (t->header_eof) {
|
327
|
+
return HPackParser::Boundary::EndOfStream;
|
328
|
+
} else {
|
329
|
+
return HPackParser::Boundary::EndOfHeaders;
|
330
|
+
}
|
331
331
|
} else {
|
332
|
-
|
332
|
+
return HPackParser::Boundary::None;
|
333
333
|
}
|
334
|
+
}
|
335
|
+
|
336
|
+
static grpc_error_handle init_header_skip_frame_parser(
|
337
|
+
grpc_chttp2_transport* t, HPackParser::Priority priority_type) {
|
338
|
+
bool is_eoh = t->expect_continuation_stream_id != 0;
|
339
|
+
t->parser = grpc_chttp2_header_parser_parse;
|
340
|
+
t->parser_data = &t->hpack_parser;
|
341
|
+
t->hpack_parser.BeginFrame(skip_header, hpack_boundary_type(t, is_eoh),
|
342
|
+
priority_type);
|
343
|
+
return GRPC_ERROR_NONE;
|
344
|
+
}
|
345
|
+
|
346
|
+
static grpc_error_handle init_non_header_skip_frame_parser(
|
347
|
+
grpc_chttp2_transport* t) {
|
348
|
+
t->parser = skip_parser;
|
334
349
|
return GRPC_ERROR_NONE;
|
335
350
|
}
|
336
351
|
|
337
352
|
void grpc_chttp2_parsing_become_skip_parser(grpc_chttp2_transport* t) {
|
338
|
-
|
353
|
+
if (t->parser == grpc_chttp2_header_parser_parse) {
|
354
|
+
t->hpack_parser.ResetSink(skip_header);
|
355
|
+
} else {
|
356
|
+
t->parser = skip_parser;
|
357
|
+
}
|
339
358
|
}
|
340
359
|
|
341
360
|
static grpc_error_handle init_data_frame_parser(grpc_chttp2_transport* t) {
|
@@ -365,12 +384,12 @@ static grpc_error_handle init_data_frame_parser(grpc_chttp2_transport* t) {
|
|
365
384
|
goto error_handler;
|
366
385
|
}
|
367
386
|
if (s == nullptr) {
|
368
|
-
return
|
387
|
+
return init_non_header_skip_frame_parser(t);
|
369
388
|
}
|
370
389
|
s->received_bytes += t->incoming_frame_size;
|
371
390
|
s->stats.incoming.framing_bytes += 9;
|
372
391
|
if (err == GRPC_ERROR_NONE && s->read_closed) {
|
373
|
-
return
|
392
|
+
return init_non_header_skip_frame_parser(t);
|
374
393
|
}
|
375
394
|
if (err == GRPC_ERROR_NONE) {
|
376
395
|
err = grpc_chttp2_data_parser_begin_frame(
|
@@ -393,7 +412,7 @@ error_handler:
|
|
393
412
|
grpc_chttp2_add_rst_stream_to_next_write(t, t->incoming_stream_id,
|
394
413
|
GRPC_HTTP2_PROTOCOL_ERROR,
|
395
414
|
&s->stats.outgoing);
|
396
|
-
return
|
415
|
+
return init_non_header_skip_frame_parser(t);
|
397
416
|
} else {
|
398
417
|
return err;
|
399
418
|
}
|
@@ -565,7 +584,7 @@ static grpc_error_handle on_trailing_header(void* tp, grpc_mdelem md) {
|
|
565
584
|
|
566
585
|
static grpc_error_handle init_header_frame_parser(grpc_chttp2_transport* t,
|
567
586
|
int is_continuation) {
|
568
|
-
|
587
|
+
const bool is_eoh =
|
569
588
|
(t->incoming_frame_flags & GRPC_CHTTP2_DATA_FLAG_END_HEADERS) != 0;
|
570
589
|
grpc_chttp2_stream* s;
|
571
590
|
|
@@ -582,6 +601,11 @@ static grpc_error_handle init_header_frame_parser(grpc_chttp2_transport* t,
|
|
582
601
|
(t->incoming_frame_flags & GRPC_CHTTP2_DATA_FLAG_END_STREAM) != 0;
|
583
602
|
}
|
584
603
|
|
604
|
+
const auto priority_type = !is_continuation && (t->incoming_frame_flags &
|
605
|
+
GRPC_CHTTP2_FLAG_HAS_PRIORITY)
|
606
|
+
? HPackParser::Priority::Included
|
607
|
+
: HPackParser::Priority::None;
|
608
|
+
|
585
609
|
t->ping_state.last_ping_sent_time = GRPC_MILLIS_INF_PAST;
|
586
610
|
|
587
611
|
/* could be a new grpc_chttp2_stream or an existing grpc_chttp2_stream */
|
@@ -591,7 +615,7 @@ static grpc_error_handle init_header_frame_parser(grpc_chttp2_transport* t,
|
|
591
615
|
GRPC_CHTTP2_IF_TRACING(
|
592
616
|
gpr_log(GPR_ERROR,
|
593
617
|
"grpc_chttp2_stream disbanded before CONTINUATION received"));
|
594
|
-
return
|
618
|
+
return init_header_skip_frame_parser(t, priority_type);
|
595
619
|
}
|
596
620
|
if (t->is_client) {
|
597
621
|
if (GPR_LIKELY((t->incoming_stream_id & 1) &&
|
@@ -601,11 +625,7 @@ static grpc_error_handle init_header_frame_parser(grpc_chttp2_transport* t,
|
|
601
625
|
GRPC_CHTTP2_IF_TRACING(gpr_log(
|
602
626
|
GPR_ERROR, "ignoring new grpc_chttp2_stream creation on client"));
|
603
627
|
}
|
604
|
-
|
605
|
-
if (t->incoming_frame_flags & GRPC_CHTTP2_FLAG_HAS_PRIORITY) {
|
606
|
-
grpc_chttp2_hpack_parser_set_has_priority(&t->hpack_parser);
|
607
|
-
}
|
608
|
-
return err;
|
628
|
+
return init_header_skip_frame_parser(t, priority_type);
|
609
629
|
} else if (GPR_UNLIKELY(t->last_new_stream_id >= t->incoming_stream_id)) {
|
610
630
|
GRPC_CHTTP2_IF_TRACING(gpr_log(
|
611
631
|
GPR_ERROR,
|
@@ -613,13 +633,13 @@ static grpc_error_handle init_header_frame_parser(grpc_chttp2_transport* t,
|
|
613
633
|
"last grpc_chttp2_stream "
|
614
634
|
"id=%d, new grpc_chttp2_stream id=%d",
|
615
635
|
t->last_new_stream_id, t->incoming_stream_id));
|
616
|
-
return
|
636
|
+
return init_header_skip_frame_parser(t, priority_type);
|
617
637
|
} else if (GPR_UNLIKELY((t->incoming_stream_id & 1) == 0)) {
|
618
638
|
GRPC_CHTTP2_IF_TRACING(gpr_log(
|
619
639
|
GPR_ERROR,
|
620
640
|
"ignoring grpc_chttp2_stream with non-client generated index %d",
|
621
641
|
t->incoming_stream_id));
|
622
|
-
return
|
642
|
+
return init_header_skip_frame_parser(t, priority_type);
|
623
643
|
} else if (GPR_UNLIKELY(
|
624
644
|
grpc_chttp2_stream_map_size(&t->stream_map) >=
|
625
645
|
t->settings[GRPC_ACKED_SETTINGS]
|
@@ -632,7 +652,7 @@ static grpc_error_handle init_header_frame_parser(grpc_chttp2_transport* t,
|
|
632
652
|
if (GPR_UNLIKELY(s == nullptr)) {
|
633
653
|
GRPC_CHTTP2_IF_TRACING(
|
634
654
|
gpr_log(GPR_ERROR, "grpc_chttp2_stream not accepted"));
|
635
|
-
return
|
655
|
+
return init_header_skip_frame_parser(t, priority_type);
|
636
656
|
}
|
637
657
|
if (t->channelz_socket != nullptr) {
|
638
658
|
t->channelz_socket->RecordStreamStartedFromRemote();
|
@@ -646,13 +666,14 @@ static grpc_error_handle init_header_frame_parser(grpc_chttp2_transport* t,
|
|
646
666
|
GRPC_CHTTP2_IF_TRACING(gpr_log(
|
647
667
|
GPR_ERROR, "skipping already closed grpc_chttp2_stream header"));
|
648
668
|
t->incoming_stream = nullptr;
|
649
|
-
return
|
669
|
+
return init_header_skip_frame_parser(t, priority_type);
|
650
670
|
}
|
651
671
|
t->parser = grpc_chttp2_header_parser_parse;
|
652
672
|
t->parser_data = &t->hpack_parser;
|
653
673
|
if (t->header_eof) {
|
654
674
|
s->eos_received = true;
|
655
675
|
}
|
676
|
+
HPackParser::Sink on_header;
|
656
677
|
switch (s->header_frames_received) {
|
657
678
|
case 0:
|
658
679
|
if (t->is_client && t->header_eof) {
|
@@ -660,27 +681,22 @@ static grpc_error_handle init_header_frame_parser(grpc_chttp2_transport* t,
|
|
660
681
|
if (s->trailing_metadata_available != nullptr) {
|
661
682
|
*s->trailing_metadata_available = true;
|
662
683
|
}
|
663
|
-
|
684
|
+
on_header = [t](grpc_mdelem md) { return on_trailing_header(t, md); };
|
664
685
|
} else {
|
665
686
|
GRPC_CHTTP2_IF_TRACING(gpr_log(GPR_INFO, "parsing initial_metadata"));
|
666
|
-
|
687
|
+
on_header = [t](grpc_mdelem md) { return on_initial_header(t, md); };
|
667
688
|
}
|
668
689
|
break;
|
669
690
|
case 1:
|
670
691
|
GRPC_CHTTP2_IF_TRACING(gpr_log(GPR_INFO, "parsing trailing_metadata"));
|
671
|
-
|
692
|
+
on_header = [t](grpc_mdelem md) { return on_trailing_header(t, md); };
|
672
693
|
break;
|
673
694
|
case 2:
|
674
695
|
gpr_log(GPR_ERROR, "too many header frames received");
|
675
|
-
return
|
676
|
-
}
|
677
|
-
t->hpack_parser.on_header_user_data = t;
|
678
|
-
t->hpack_parser.is_boundary = is_eoh;
|
679
|
-
t->hpack_parser.is_eof = static_cast<uint8_t>(is_eoh ? t->header_eof : 0);
|
680
|
-
if (!is_continuation &&
|
681
|
-
(t->incoming_frame_flags & GRPC_CHTTP2_FLAG_HAS_PRIORITY)) {
|
682
|
-
grpc_chttp2_hpack_parser_set_has_priority(&t->hpack_parser);
|
696
|
+
return init_header_skip_frame_parser(t, priority_type);
|
683
697
|
}
|
698
|
+
t->hpack_parser.BeginFrame(std::move(on_header),
|
699
|
+
hpack_boundary_type(t, is_eoh), priority_type);
|
684
700
|
return GRPC_ERROR_NONE;
|
685
701
|
}
|
686
702
|
|
@@ -694,7 +710,7 @@ static grpc_error_handle init_window_update_frame_parser(
|
|
694
710
|
grpc_chttp2_stream* s = t->incoming_stream =
|
695
711
|
grpc_chttp2_parsing_lookup_stream(t, t->incoming_stream_id);
|
696
712
|
if (s == nullptr) {
|
697
|
-
return
|
713
|
+
return init_non_header_skip_frame_parser(t);
|
698
714
|
}
|
699
715
|
s->stats.incoming.framing_bytes += 9;
|
700
716
|
}
|
@@ -719,7 +735,7 @@ static grpc_error_handle init_rst_stream_parser(grpc_chttp2_transport* t) {
|
|
719
735
|
grpc_chttp2_stream* s = t->incoming_stream =
|
720
736
|
grpc_chttp2_parsing_lookup_stream(t, t->incoming_stream_id);
|
721
737
|
if (!t->incoming_stream) {
|
722
|
-
return
|
738
|
+
return init_non_header_skip_frame_parser(t);
|
723
739
|
}
|
724
740
|
s->stats.incoming.framing_bytes += 9;
|
725
741
|
t->parser = grpc_chttp2_rst_stream_parser_parse;
|
@@ -752,7 +768,7 @@ static grpc_error_handle init_settings_frame_parser(grpc_chttp2_transport* t) {
|
|
752
768
|
memcpy(t->settings[GRPC_ACKED_SETTINGS], t->settings[GRPC_SENT_SETTINGS],
|
753
769
|
GRPC_CHTTP2_NUM_SETTINGS * sizeof(uint32_t));
|
754
770
|
grpc_chttp2_hptbl_set_max_bytes(
|
755
|
-
|
771
|
+
t->hpack_parser.hpack_table(),
|
756
772
|
t->settings[GRPC_ACKED_SETTINGS]
|
757
773
|
[GRPC_CHTTP2_SETTINGS_HEADER_TABLE_SIZE]);
|
758
774
|
t->sent_local_settings = false;
|