grpc 1.54.0 → 1.54.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +2 -2
  3. data/src/core/ext/filters/client_channel/client_channel.cc +4 -6
  4. data/src/core/ext/filters/client_channel/client_channel.h +2 -0
  5. data/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +1 -1
  6. data/src/core/ext/gcp/metadata_query.cc +5 -10
  7. data/src/core/ext/gcp/metadata_query.h +10 -5
  8. data/src/core/ext/transport/chttp2/transport/bin_encoder.cc +12 -8
  9. data/src/core/ext/transport/chttp2/transport/bin_encoder.h +5 -1
  10. data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +118 -222
  11. data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +295 -113
  12. data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc +2 -0
  13. data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.h +2 -0
  14. data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +451 -277
  15. data/src/core/ext/transport/chttp2/transport/hpack_parser.h +3 -1
  16. data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +14 -12
  17. data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +9 -1
  18. data/src/core/lib/event_engine/event_engine.cc +4 -4
  19. data/src/core/lib/event_engine/posix_engine/posix_engine.h +1 -0
  20. data/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc +29 -0
  21. data/src/core/lib/event_engine/posix_engine/posix_engine_listener.h +3 -0
  22. data/src/core/lib/iomgr/tcp_server_posix.cc +39 -14
  23. data/src/core/lib/iomgr/tcp_server_utils_posix.h +12 -0
  24. data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +21 -0
  25. data/src/core/lib/surface/validate_metadata.cc +43 -42
  26. data/src/core/lib/surface/validate_metadata.h +9 -0
  27. data/src/core/lib/transport/metadata_batch.h +110 -2
  28. data/src/core/lib/transport/parsed_metadata.h +16 -6
  29. data/src/ruby/lib/grpc/version.rb +1 -1
  30. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8b93211ad42aa2bd331c1e48525d7da6e285f78267667a1db520323eb0c3ded8
4
- data.tar.gz: 4832e9b7b8ad0226400403463f2acdd495c288393d1abbab128ef7921a723e16
3
+ metadata.gz: d711d99d6ff118f1995857a501d43285a4949c571c4a15dc9c01214f83b5e5f9
4
+ data.tar.gz: af50cfde4b585decdb3eff98182c02bc0f1f77beeb2ea282de75d785df0b5ca4
5
5
  SHA512:
6
- metadata.gz: 1bab1f3cce4502c6bcc6d8a79882c98cfdeee3d45de6bb14861394278f7236f73ec3a0ab846c9a62e261d8c451bfc3cad0b312c988d7e8557b052ad602dff738
7
- data.tar.gz: b6b67f7dbf152c55cc69d131d660f5f009cbb3d2a36c72559f7e910eae22f85e42ec10562e180f56d6cdba8e21a60bafb0cf900191994ae2971771769788bdc8
6
+ metadata.gz: 30c5de74b5a8d4cb6747799863e0189f31406b5dc247dd8321aa724eeda3c2429c59cf0f9103fd64a54481d474e7b639a162cecc0eb20eaa1d671f887b50ff5e
7
+ data.tar.gz: 45076a87b0b33bd3ee672e59dc7a3904b44f2db416ec2f3f58e170a1f1c5dc6588199a1a37fbba617f6f616b39eec7c880268f20b0489aa2f9674baaca53a999
data/Makefile CHANGED
@@ -411,8 +411,8 @@ Q = @
411
411
  endif
412
412
 
413
413
  CORE_VERSION = 31.0.0
414
- CPP_VERSION = 1.54.0
415
- CSHARP_VERSION = 2.54.0
414
+ CPP_VERSION = 1.54.3
415
+ CSHARP_VERSION = 2.54.3
416
416
 
417
417
  CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES))
418
418
  CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS)
@@ -3037,6 +3037,8 @@ void ClientChannel::FilterBasedLoadBalancedCall::RecvInitialMetadataReady(
3037
3037
  // recv_initial_metadata_flags is not populated for clients
3038
3038
  self->call_attempt_tracer()->RecordReceivedInitialMetadata(
3039
3039
  self->recv_initial_metadata_);
3040
+ auto* peer_string = self->recv_initial_metadata_->get_pointer(PeerString());
3041
+ if (peer_string != nullptr) self->peer_string_ = peer_string->Ref();
3040
3042
  }
3041
3043
  Closure::Run(DEBUG_LOCATION, self->original_recv_initial_metadata_ready_,
3042
3044
  error);
@@ -3080,12 +3082,8 @@ void ClientChannel::FilterBasedLoadBalancedCall::RecvTrailingMetadataReady(
3080
3082
  }
3081
3083
  }
3082
3084
  absl::string_view peer_string;
3083
- if (self->recv_initial_metadata_ != nullptr) {
3084
- Slice* peer_string_slice =
3085
- self->recv_initial_metadata_->get_pointer(PeerString());
3086
- if (peer_string_slice != nullptr) {
3087
- peer_string = peer_string_slice->as_string_view();
3088
- }
3085
+ if (self->peer_string_.has_value()) {
3086
+ peer_string = self->peer_string_->as_string_view();
3089
3087
  }
3090
3088
  self->RecordCallCompletion(status, self->recv_trailing_metadata_,
3091
3089
  self->transport_stream_stats_, peer_string);
@@ -63,6 +63,7 @@
63
63
  #include "src/core/lib/resolver/resolver.h"
64
64
  #include "src/core/lib/resource_quota/arena.h"
65
65
  #include "src/core/lib/service_config/service_config.h"
66
+ #include "src/core/lib/slice/slice.h"
66
67
  #include "src/core/lib/surface/channel.h"
67
68
  #include "src/core/lib/transport/connectivity_state.h"
68
69
  #include "src/core/lib/transport/metadata_batch.h"
@@ -548,6 +549,7 @@ class ClientChannel::FilterBasedLoadBalancedCall
548
549
  CallCombiner* call_combiner_;
549
550
  grpc_polling_entity* pollent_;
550
551
  grpc_closure* on_call_destruction_complete_;
552
+ absl::optional<Slice> peer_string_;
551
553
 
552
554
  // Set when we get a cancel_stream op.
553
555
  grpc_error_handle cancel_error_;
@@ -116,7 +116,7 @@ constexpr absl::string_view kRls = "rls_experimental";
116
116
  const char kGrpc[] = "grpc";
117
117
  const char* kRlsRequestPath = "/grpc.lookup.v1.RouteLookupService/RouteLookup";
118
118
  const char* kFakeTargetFieldValue = "fake_target_field_value";
119
- const char* kRlsHeaderKey = "X-Google-RLS-Data";
119
+ const char* kRlsHeaderKey = "x-google-rls-data";
120
120
 
121
121
  const Duration kDefaultLookupServiceTimeout = Duration::Seconds(10);
122
122
  const Duration kMaxMaxAge = Duration::Minutes(5);
@@ -46,16 +46,11 @@ namespace grpc_core {
46
46
 
47
47
  TraceFlag grpc_metadata_query_trace(false, "metadata_query");
48
48
 
49
- constexpr const char MetadataQuery::kZoneAttribute[] =
50
- "/computeMetadata/v1/instance/zone";
51
- constexpr const char MetadataQuery::kClusterNameAttribute[] =
52
- "/computeMetadata/v1/instance/attributes/cluster-name";
53
- constexpr const char MetadataQuery::kRegionAttribute[] =
54
- "/computeMetadata/v1/instance/region";
55
- constexpr const char MetadataQuery::kInstanceIdAttribute[] =
56
- "/computeMetadata/v1/instance/id";
57
- constexpr const char MetadataQuery::kIPv6Attribute[] =
58
- "/computeMetadata/v1/instance/network-interfaces/0/ipv6s";
49
+ constexpr const char MetadataQuery::kZoneAttribute[];
50
+ constexpr const char MetadataQuery::kClusterNameAttribute[];
51
+ constexpr const char MetadataQuery::kRegionAttribute[];
52
+ constexpr const char MetadataQuery::kInstanceIdAttribute[];
53
+ constexpr const char MetadataQuery::kIPv6Attribute[];
59
54
 
60
55
  MetadataQuery::MetadataQuery(
61
56
  std::string attribute, grpc_polling_entity* pollent,
@@ -38,11 +38,16 @@ namespace grpc_core {
38
38
  // environment.
39
39
  class MetadataQuery : public InternallyRefCounted<MetadataQuery> {
40
40
  public:
41
- static const char kZoneAttribute[];
42
- static const char kClusterNameAttribute[];
43
- static const char kRegionAttribute[];
44
- static const char kInstanceIdAttribute[];
45
- static const char kIPv6Attribute[];
41
+ static constexpr const char kZoneAttribute[] =
42
+ "/computeMetadata/v1/instance/zone";
43
+ static constexpr const char kClusterNameAttribute[] =
44
+ "/computeMetadata/v1/instance/attributes/cluster-name";
45
+ static constexpr const char kRegionAttribute[] =
46
+ "/computeMetadata/v1/instance/region";
47
+ static constexpr const char kInstanceIdAttribute[] =
48
+ "/computeMetadata/v1/instance/id";
49
+ static constexpr const char kIPv6Attribute[] =
50
+ "/computeMetadata/v1/instance/network-interfaces/0/ipv6s";
46
51
 
47
52
  MetadataQuery(
48
53
  std::string attribute, grpc_polling_entity* pollent,
@@ -149,7 +149,8 @@ static void enc_flush_some(huff_out* out) {
149
149
  }
150
150
  }
151
151
 
152
- static void enc_add2(huff_out* out, uint8_t a, uint8_t b) {
152
+ static void enc_add2(huff_out* out, uint8_t a, uint8_t b, uint32_t* wire_size) {
153
+ *wire_size += 2;
153
154
  b64_huff_sym sa = huff_alphabet[a];
154
155
  b64_huff_sym sb = huff_alphabet[b];
155
156
  out->temp = (out->temp << (sa.length + sb.length)) |
@@ -159,7 +160,8 @@ static void enc_add2(huff_out* out, uint8_t a, uint8_t b) {
159
160
  enc_flush_some(out);
160
161
  }
161
162
 
162
- static void enc_add1(huff_out* out, uint8_t a) {
163
+ static void enc_add1(huff_out* out, uint8_t a, uint32_t* wire_size) {
164
+ *wire_size += 1;
163
165
  b64_huff_sym sa = huff_alphabet[a];
164
166
  out->temp = (out->temp << sa.length) | sa.bits;
165
167
  out->temp_length += sa.length;
@@ -167,7 +169,7 @@ static void enc_add1(huff_out* out, uint8_t a) {
167
169
  }
168
170
 
169
171
  grpc_slice grpc_chttp2_base64_encode_and_huffman_compress(
170
- const grpc_slice& input) {
172
+ const grpc_slice& input, uint32_t* wire_size) {
171
173
  size_t input_length = GRPC_SLICE_LENGTH(input);
172
174
  size_t input_triplets = input_length / 3;
173
175
  size_t tail_case = input_length % 3;
@@ -183,16 +185,17 @@ grpc_slice grpc_chttp2_base64_encode_and_huffman_compress(
183
185
  out.temp = 0;
184
186
  out.temp_length = 0;
185
187
  out.out = start_out;
188
+ *wire_size = 0;
186
189
 
187
190
  // encode full triplets
188
191
  for (i = 0; i < input_triplets; i++) {
189
192
  const uint8_t low_to_high = static_cast<uint8_t>((in[0] & 0x3) << 4);
190
193
  const uint8_t high_to_low = in[1] >> 4;
191
- enc_add2(&out, in[0] >> 2, low_to_high | high_to_low);
194
+ enc_add2(&out, in[0] >> 2, low_to_high | high_to_low, wire_size);
192
195
 
193
196
  const uint8_t a = static_cast<uint8_t>((in[1] & 0xf) << 2);
194
197
  const uint8_t b = (in[2] >> 6);
195
- enc_add2(&out, a | b, in[2] & 0x3f);
198
+ enc_add2(&out, a | b, in[2] & 0x3f, wire_size);
196
199
  in += 3;
197
200
  }
198
201
 
@@ -201,14 +204,15 @@ grpc_slice grpc_chttp2_base64_encode_and_huffman_compress(
201
204
  case 0:
202
205
  break;
203
206
  case 1:
204
- enc_add2(&out, in[0] >> 2, static_cast<uint8_t>((in[0] & 0x3) << 4));
207
+ enc_add2(&out, in[0] >> 2, static_cast<uint8_t>((in[0] & 0x3) << 4),
208
+ wire_size);
205
209
  in += 1;
206
210
  break;
207
211
  case 2: {
208
212
  const uint8_t low_to_high = static_cast<uint8_t>((in[0] & 0x3) << 4);
209
213
  const uint8_t high_to_low = in[1] >> 4;
210
- enc_add2(&out, in[0] >> 2, low_to_high | high_to_low);
211
- enc_add1(&out, static_cast<uint8_t>((in[1] & 0xf) << 2));
214
+ enc_add2(&out, in[0] >> 2, low_to_high | high_to_low, wire_size);
215
+ enc_add1(&out, static_cast<uint8_t>((in[1] & 0xf) << 2), wire_size);
212
216
  in += 2;
213
217
  break;
214
218
  }
@@ -21,6 +21,8 @@
21
21
 
22
22
  #include <grpc/support/port_platform.h>
23
23
 
24
+ #include <stdint.h>
25
+
24
26
  #include <grpc/slice.h>
25
27
 
26
28
  // base64 encode a slice. Returns a new slice, does not take ownership of the
@@ -36,7 +38,9 @@ grpc_slice grpc_chttp2_huffman_compress(const grpc_slice& input);
36
38
  // grpc_slice y = grpc_chttp2_huffman_compress(x);
37
39
  // grpc_core::CSliceUnref( x);
38
40
  // return y;
41
+ // *wire_size is the length of the base64 encoded string prior to huffman
42
+ // compression (as is needed for hpack table math)
39
43
  grpc_slice grpc_chttp2_base64_encode_and_huffman_compress(
40
- const grpc_slice& input);
44
+ const grpc_slice& input, uint32_t* wire_size);
41
45
 
42
46
  #endif // GRPC_SRC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_BIN_ENCODER_H