grpc 1.83.0 → 1.83.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,168 +25,203 @@
25
25
  #include <zconf.h>
26
26
  #include <zlib.h>
27
27
 
28
+ #include <algorithm>
29
+ #include <cstdint>
30
+ #include <optional>
31
+
28
32
  #include "src/core/lib/slice/slice.h"
29
33
  #include "src/core/util/grpc_check.h"
34
+ #include "src/core/util/status_helper.h"
30
35
  #include "absl/log/log.h"
36
+ #include "absl/status/status.h"
37
+ #include "absl/status/statusor.h"
31
38
 
32
39
  #define OUTPUT_BLOCK_SIZE 1024
33
40
 
34
- static int zlib_body(z_stream* zs, grpc_slice_buffer* input,
35
- grpc_slice_buffer* output,
36
- int (*flate)(z_stream* zs, int flush)) {
41
+ namespace grpc_core {
42
+ namespace {
43
+
44
+ absl::StatusOr<SliceBuffer> ZlibBody(z_stream* zs, const SliceBuffer& input,
45
+ int (*flate)(z_stream* zs, int flush),
46
+ std::optional<uint32_t> max_output_size) {
37
47
  int r = Z_STREAM_END; // Do not fail on an empty input.
38
48
  int flush;
39
49
  size_t i;
40
- grpc_slice outbuf = GRPC_SLICE_MALLOC(OUTPUT_BLOCK_SIZE);
50
+ uint32_t remaining_output_size = max_output_size.value_or(UINT32_MAX);
51
+ SliceBuffer output_sb;
41
52
  const uInt uint_max = ~uInt{0};
53
+ auto outbuf = MutableSlice::CreateUninitialized(
54
+ std::min<uint32_t>(remaining_output_size, OUTPUT_BLOCK_SIZE));
42
55
 
43
- GRPC_CHECK(GRPC_SLICE_LENGTH(outbuf) <= uint_max);
44
- zs->avail_out = static_cast<uInt> GRPC_SLICE_LENGTH(outbuf);
45
- zs->next_out = GRPC_SLICE_START_PTR(outbuf);
56
+ GRPC_CHECK(outbuf.length() <= uint_max);
57
+ zs->avail_out = static_cast<uInt>(outbuf.length());
58
+ zs->next_out = const_cast<uint8_t*>(outbuf.begin());
46
59
  flush = Z_NO_FLUSH;
47
- for (i = 0; i < input->count; i++) {
48
- if (i == input->count - 1) flush = Z_FINISH;
49
- GRPC_CHECK(GRPC_SLICE_LENGTH(input->slices[i]) <= uint_max);
50
- zs->avail_in = static_cast<uInt> GRPC_SLICE_LENGTH(input->slices[i]);
51
- zs->next_in = GRPC_SLICE_START_PTR(input->slices[i]);
60
+ for (i = 0; i < input.Count(); i++) {
61
+ if (i == input.Count() - 1) {
62
+ flush = Z_FINISH;
63
+ }
64
+ GRPC_CHECK(input[i].length() <= uint_max);
65
+ zs->avail_in = static_cast<uInt>(input[i].length());
66
+ zs->next_in = const_cast<uint8_t*>(input[i].begin());
52
67
  do {
53
68
  if (zs->avail_out == 0) {
54
- grpc_slice_buffer_add_indexed(output, outbuf);
55
- outbuf = GRPC_SLICE_MALLOC(OUTPUT_BLOCK_SIZE);
56
- GRPC_CHECK(GRPC_SLICE_LENGTH(outbuf) <= uint_max);
57
- zs->avail_out = static_cast<uInt> GRPC_SLICE_LENGTH(outbuf);
58
- zs->next_out = GRPC_SLICE_START_PTR(outbuf);
69
+ if (max_output_size.has_value() && remaining_output_size == 0) {
70
+ VLOG(2) << "zlib: max provided output size exceeded";
71
+ return absl::ResourceExhaustedError(
72
+ "Decompressed message larger than max");
73
+ }
74
+ output_sb.AppendIndexed(Slice(std::move(outbuf)));
75
+ outbuf = MutableSlice::CreateUninitialized(
76
+ std::min<uint32_t>(remaining_output_size, OUTPUT_BLOCK_SIZE));
77
+ // Update remaining output size to reflect the size of the slice we just
78
+ // filled with compressed / decompressed data.
79
+ if (max_output_size.has_value()) {
80
+ remaining_output_size -= outbuf.length();
81
+ }
82
+ GRPC_CHECK(outbuf.length() <= uint_max);
83
+ zs->avail_out = static_cast<uInt>(outbuf.length());
84
+ zs->next_out = const_cast<uint8_t*>(outbuf.begin());
59
85
  }
60
86
  r = flate(zs, flush);
61
87
  if (r < 0 && r != Z_BUF_ERROR /* not fatal */) {
62
88
  VLOG(2) << "zlib error (" << r << ")";
63
- goto error;
89
+ return absl::InternalError("Decompression failed due to zlib error");
64
90
  }
65
91
  } while (zs->avail_out == 0);
66
92
  if (zs->avail_in) {
67
93
  VLOG(2) << "zlib: not all input consumed";
68
- goto error;
94
+ return absl::InternalError(
95
+ "Decompression failed due to not all input "
96
+ "consumed");
69
97
  }
70
98
  }
71
99
  if (r != Z_STREAM_END) {
72
100
  VLOG(2) << "zlib: Data error";
73
- goto error;
101
+ return absl::InternalError("Decompression failed due to data error");
74
102
  }
75
103
 
76
- GRPC_CHECK(outbuf.refcount);
77
- outbuf.data.refcounted.length -= zs->avail_out;
78
- grpc_slice_buffer_add_indexed(output, outbuf);
79
-
80
- return 1;
81
-
82
- error:
83
- grpc_core::CSliceUnref(outbuf);
84
- return 0;
104
+ // TODO(vigneshbabu): Add a Truncate() method to the Slice type to avoid using
105
+ // the underlying C type here.
106
+ grpc_slice slice = outbuf.TakeCSlice();
107
+ if (slice.refcount) {
108
+ slice.data.refcounted.length -= zs->avail_out;
109
+ } else {
110
+ slice.data.inlined.length -= zs->avail_out;
111
+ }
112
+ output_sb.AppendIndexed(Slice(slice));
113
+ return output_sb;
85
114
  }
86
115
 
87
- static void* zalloc_gpr(void* /*opaque*/, unsigned int items,
88
- unsigned int size) {
116
+ void* ZallocGpr(void* /*opaque*/, unsigned int items, unsigned int size) {
89
117
  return gpr_malloc(items * size);
90
118
  }
91
119
 
92
- static void zfree_gpr(void* /*opaque*/, void* address) { gpr_free(address); }
120
+ void ZFreeGpr(void* /*opaque*/, void* address) { gpr_free(address); }
93
121
 
94
- static int zlib_compress(grpc_slice_buffer* input, grpc_slice_buffer* output,
95
- int gzip) {
122
+ std::optional<SliceBuffer> ZlibCompress(const SliceBuffer& input, int gzip) {
96
123
  z_stream zs;
97
- int r;
98
- size_t i;
99
- size_t count_before = output->count;
100
- size_t length_before = output->length;
124
+ absl::StatusOr<SliceBuffer> compression_result;
101
125
  memset(&zs, 0, sizeof(zs));
102
- zs.zalloc = zalloc_gpr;
103
- zs.zfree = zfree_gpr;
104
- r = deflateInit2(&zs, Z_DEFAULT_COMPRESSION, Z_DEFLATED, 15 | (gzip ? 16 : 0),
105
- 8, Z_DEFAULT_STRATEGY);
126
+ zs.zalloc = ZallocGpr;
127
+ zs.zfree = ZFreeGpr;
128
+ bool r = deflateInit2(&zs, Z_DEFAULT_COMPRESSION, Z_DEFLATED,
129
+ 15 | (gzip ? 16 : 0), 8, Z_DEFAULT_STRATEGY);
106
130
  GRPC_CHECK(r == Z_OK);
107
- r = zlib_body(&zs, input, output, deflate) && output->length < input->length;
108
- if (!r) {
109
- for (i = count_before; i < output->count; i++) {
110
- grpc_core::CSliceUnref(output->slices[i]);
111
- }
112
- output->count = count_before;
113
- output->length = length_before;
114
- }
131
+ compression_result = ZlibBody(&zs, input, deflate, input.Length());
115
132
  deflateEnd(&zs);
116
- return r;
133
+ if (compression_result.ok() &&
134
+ compression_result->Length() < input.Length()) {
135
+ return std::move(*compression_result);
136
+ }
137
+ return std::nullopt;
117
138
  }
118
139
 
119
- static int zlib_decompress(grpc_slice_buffer* input, grpc_slice_buffer* output,
120
- int gzip) {
140
+ absl::StatusOr<SliceBuffer> ZlibDecompress(
141
+ const SliceBuffer& input, int gzip,
142
+ std::optional<uint32_t> max_output_size) {
121
143
  z_stream zs;
122
- int r;
123
- size_t i;
124
- size_t count_before = output->count;
125
- size_t length_before = output->length;
144
+ absl::StatusOr<SliceBuffer> decompression_result;
126
145
  memset(&zs, 0, sizeof(zs));
127
- zs.zalloc = zalloc_gpr;
128
- zs.zfree = zfree_gpr;
129
- r = inflateInit2(&zs, 15 | (gzip ? 16 : 0));
146
+ zs.zalloc = ZallocGpr;
147
+ zs.zfree = ZFreeGpr;
148
+ bool r = inflateInit2(&zs, 15 | (gzip ? 16 : 0));
130
149
  GRPC_CHECK(r == Z_OK);
131
- r = zlib_body(&zs, input, output, inflate);
132
- if (!r) {
133
- for (i = count_before; i < output->count; i++) {
134
- grpc_core::CSliceUnref(output->slices[i]);
135
- }
136
- output->count = count_before;
137
- output->length = length_before;
138
- }
150
+ decompression_result = ZlibBody(&zs, input, inflate, max_output_size);
139
151
  inflateEnd(&zs);
140
- return r;
152
+ return decompression_result;
141
153
  }
142
154
 
143
- static int copy(grpc_slice_buffer* input, grpc_slice_buffer* output) {
144
- size_t i;
145
- for (i = 0; i < input->count; i++) {
146
- grpc_slice_buffer_add(output, grpc_core::CSliceRef(input->slices[i]));
147
- }
148
- return 1;
149
- }
155
+ } // namespace
150
156
 
151
- static int compress_inner(grpc_compression_algorithm algorithm,
152
- grpc_slice_buffer* input, grpc_slice_buffer* output) {
157
+ std::optional<SliceBuffer> MessageCompress(grpc_compression_algorithm algorithm,
158
+ const SliceBuffer& input) {
153
159
  switch (algorithm) {
154
160
  case GRPC_COMPRESS_NONE:
155
161
  // the fallback path always needs to be send uncompressed: we simply
156
162
  // rely on that here
157
- return 0;
163
+ return std::nullopt;
158
164
  case GRPC_COMPRESS_DEFLATE:
159
- return zlib_compress(input, output, 0);
165
+ return ZlibCompress(input, 0);
160
166
  case GRPC_COMPRESS_GZIP:
161
- return zlib_compress(input, output, 1);
167
+ return ZlibCompress(input, 1);
162
168
  case GRPC_COMPRESS_ALGORITHMS_COUNT:
163
169
  break;
164
170
  }
165
171
  LOG(ERROR) << "invalid compression algorithm " << algorithm;
166
- return 0;
172
+ return std::nullopt;
167
173
  }
168
174
 
175
+ absl::StatusOr<SliceBuffer> MessageDecompress(
176
+ grpc_compression_algorithm algorithm, const SliceBuffer& input,
177
+ std::optional<uint32_t> max_output_size) {
178
+ switch (algorithm) {
179
+ case GRPC_COMPRESS_NONE: {
180
+ SliceBuffer output;
181
+ output.Append(input);
182
+ return output;
183
+ }
184
+ case GRPC_COMPRESS_DEFLATE:
185
+ return ZlibDecompress(input, 0, max_output_size);
186
+ case GRPC_COMPRESS_GZIP:
187
+ return ZlibDecompress(input, 1, max_output_size);
188
+ case GRPC_COMPRESS_ALGORITHMS_COUNT:
189
+ break;
190
+ }
191
+ LOG(ERROR) << "invalid compression algorithm " << algorithm;
192
+ return absl::InternalError("Invalid compression algorithm");
193
+ }
194
+
195
+ } // namespace grpc_core
196
+
169
197
  int grpc_msg_compress(grpc_compression_algorithm algorithm,
170
198
  grpc_slice_buffer* input, grpc_slice_buffer* output) {
171
- if (!compress_inner(algorithm, input, output)) {
172
- copy(input, output);
173
- return 0;
199
+ int retval = 1;
200
+ grpc_core::SliceBuffer input_sb;
201
+ grpc_slice_buffer_swap(input, input_sb.c_slice_buffer());
202
+ std::optional<grpc_core::SliceBuffer> output_sb =
203
+ grpc_core::MessageCompress(algorithm, input_sb);
204
+ if (!output_sb.has_value()) {
205
+ output_sb.emplace();
206
+ output_sb->Append(input_sb);
207
+ retval = 0;
174
208
  }
175
- return 1;
209
+ grpc_slice_buffer_swap(input, input_sb.c_slice_buffer());
210
+ grpc_slice_buffer_swap(output, output_sb->c_slice_buffer());
211
+ return retval;
176
212
  }
177
213
 
178
214
  int grpc_msg_decompress(grpc_compression_algorithm algorithm,
179
215
  grpc_slice_buffer* input, grpc_slice_buffer* output) {
180
- switch (algorithm) {
181
- case GRPC_COMPRESS_NONE:
182
- return copy(input, output);
183
- case GRPC_COMPRESS_DEFLATE:
184
- return zlib_decompress(input, output, 0);
185
- case GRPC_COMPRESS_GZIP:
186
- return zlib_decompress(input, output, 1);
187
- case GRPC_COMPRESS_ALGORITHMS_COUNT:
188
- break;
216
+ grpc_core::SliceBuffer input_sb;
217
+ grpc_slice_buffer_swap(input, input_sb.c_slice_buffer());
218
+
219
+ absl::StatusOr<grpc_core::SliceBuffer> output_sb =
220
+ grpc_core::MessageDecompress(algorithm, input_sb, std::nullopt);
221
+ if (!output_sb.ok()) {
222
+ return 0;
189
223
  }
190
- LOG(ERROR) << "invalid compression algorithm " << algorithm;
191
- return 0;
224
+ grpc_slice_buffer_swap(input, input_sb.c_slice_buffer());
225
+ grpc_slice_buffer_swap(output, output_sb->c_slice_buffer());
226
+ return 1;
192
227
  }
@@ -23,6 +23,13 @@
23
23
  #include <grpc/slice.h>
24
24
  #include <grpc/support/port_platform.h>
25
25
 
26
+ #include <cstdint>
27
+ #include <optional>
28
+
29
+ #include "src/core/lib/slice/slice_buffer.h"
30
+ #include "absl/status/status.h"
31
+ #include "absl/status/statusor.h"
32
+
26
33
  // compress 'input' to 'output' using 'algorithm'.
27
34
  // On success, appends compressed slices to output and returns 1.
28
35
  // On failure, appends uncompressed slices to output and returns 0.
@@ -35,4 +42,21 @@ int grpc_msg_compress(grpc_compression_algorithm algorithm,
35
42
  int grpc_msg_decompress(grpc_compression_algorithm algorithm,
36
43
  grpc_slice_buffer* input, grpc_slice_buffer* output);
37
44
 
45
+ namespace grpc_core {
46
+
47
+ // Compresses 'input' using 'algorithm'.
48
+ // On success, returns a SliceBuffer containing the compressed data.
49
+ // On failure, returns nullopt.
50
+ std::optional<SliceBuffer> MessageCompress(grpc_compression_algorithm algorithm,
51
+ const SliceBuffer& input);
52
+ // Decompresses 'input'.
53
+ // On success, returns a SliceBuffer containing the decompressed data.
54
+ // On failure, returns a non-OK status.
55
+ // Fails if the decompressed data would be larger than max_output_size.
56
+ absl::StatusOr<SliceBuffer> MessageDecompress(
57
+ grpc_compression_algorithm algorithm, const SliceBuffer& input,
58
+ std::optional<uint32_t> max_output_size);
59
+
60
+ } // namespace grpc_core
61
+
38
62
  #endif // GRPC_SRC_CORE_LIB_COMPRESSION_MESSAGE_COMPRESS_H
@@ -103,6 +103,9 @@ const char* const description_h2_max_deallocating_streams_headroom =
103
103
  "Separate allocated max concurrent streams.";
104
104
  const char* const additional_constraints_h2_max_deallocating_streams_headroom =
105
105
  "{}";
106
+ const char* const description_header_data_frame =
107
+ "Managing header and data memory better";
108
+ const char* const additional_constraints_header_data_frame = "{}";
106
109
  const char* const description_inproc_cancel_stream =
107
110
  "If set, cancel inproc stream inside the transport mutex.";
108
111
  const char* const additional_constraints_inproc_cancel_stream = "{}";
@@ -336,6 +339,8 @@ const ExperimentMetadata g_experiment_metadata[] = {
336
339
  description_h2_max_deallocating_streams_headroom,
337
340
  additional_constraints_h2_max_deallocating_streams_headroom, nullptr, 0,
338
341
  false, true},
342
+ {"header_data_frame", description_header_data_frame,
343
+ additional_constraints_header_data_frame, nullptr, 0, true, true},
339
344
  {"inproc_cancel_stream", description_inproc_cancel_stream,
340
345
  additional_constraints_inproc_cancel_stream, nullptr, 0, true, true},
341
346
  {"keep_alive_ping_timer_batch", description_keep_alive_ping_timer_batch,
@@ -348,7 +353,7 @@ const ExperimentMetadata g_experiment_metadata[] = {
348
353
  {"memory_optimization_02", description_memory_optimization_02,
349
354
  additional_constraints_memory_optimization_02, nullptr, 0, false, false},
350
355
  {"message_size_refactoring", description_message_size_refactoring,
351
- additional_constraints_message_size_refactoring, nullptr, 0, false, true},
356
+ additional_constraints_message_size_refactoring, nullptr, 0, true, true},
352
357
  {"metadata_outstanding_token_refactor",
353
358
  description_metadata_outstanding_token_refactor,
354
359
  additional_constraints_metadata_outstanding_token_refactor, nullptr, 0,
@@ -380,7 +385,7 @@ const ExperimentMetadata g_experiment_metadata[] = {
380
385
  {"ph2_client_server", description_ph2_client_server,
381
386
  additional_constraints_ph2_client_server, nullptr, 0, false, true},
382
387
  {"ph2_perf_01", description_ph2_perf_01, additional_constraints_ph2_perf_01,
383
- nullptr, 0, false, true},
388
+ nullptr, 0, true, true},
384
389
  {"ph2_server", description_ph2_server, additional_constraints_ph2_server,
385
390
  nullptr, 0, false, true},
386
391
  {"pick_first_ignore_empty_updates",
@@ -554,6 +559,9 @@ const char* const description_h2_max_deallocating_streams_headroom =
554
559
  "Separate allocated max concurrent streams.";
555
560
  const char* const additional_constraints_h2_max_deallocating_streams_headroom =
556
561
  "{}";
562
+ const char* const description_header_data_frame =
563
+ "Managing header and data memory better";
564
+ const char* const additional_constraints_header_data_frame = "{}";
557
565
  const char* const description_inproc_cancel_stream =
558
566
  "If set, cancel inproc stream inside the transport mutex.";
559
567
  const char* const additional_constraints_inproc_cancel_stream = "{}";
@@ -787,6 +795,8 @@ const ExperimentMetadata g_experiment_metadata[] = {
787
795
  description_h2_max_deallocating_streams_headroom,
788
796
  additional_constraints_h2_max_deallocating_streams_headroom, nullptr, 0,
789
797
  false, true},
798
+ {"header_data_frame", description_header_data_frame,
799
+ additional_constraints_header_data_frame, nullptr, 0, true, true},
790
800
  {"inproc_cancel_stream", description_inproc_cancel_stream,
791
801
  additional_constraints_inproc_cancel_stream, nullptr, 0, true, true},
792
802
  {"keep_alive_ping_timer_batch", description_keep_alive_ping_timer_batch,
@@ -799,7 +809,7 @@ const ExperimentMetadata g_experiment_metadata[] = {
799
809
  {"memory_optimization_02", description_memory_optimization_02,
800
810
  additional_constraints_memory_optimization_02, nullptr, 0, false, false},
801
811
  {"message_size_refactoring", description_message_size_refactoring,
802
- additional_constraints_message_size_refactoring, nullptr, 0, false, true},
812
+ additional_constraints_message_size_refactoring, nullptr, 0, true, true},
803
813
  {"metadata_outstanding_token_refactor",
804
814
  description_metadata_outstanding_token_refactor,
805
815
  additional_constraints_metadata_outstanding_token_refactor, nullptr, 0,
@@ -831,7 +841,7 @@ const ExperimentMetadata g_experiment_metadata[] = {
831
841
  {"ph2_client_server", description_ph2_client_server,
832
842
  additional_constraints_ph2_client_server, nullptr, 0, false, true},
833
843
  {"ph2_perf_01", description_ph2_perf_01, additional_constraints_ph2_perf_01,
834
- nullptr, 0, false, true},
844
+ nullptr, 0, true, true},
835
845
  {"ph2_server", description_ph2_server, additional_constraints_ph2_server,
836
846
  nullptr, 0, false, true},
837
847
  {"pick_first_ignore_empty_updates",
@@ -1005,6 +1015,9 @@ const char* const description_h2_max_deallocating_streams_headroom =
1005
1015
  "Separate allocated max concurrent streams.";
1006
1016
  const char* const additional_constraints_h2_max_deallocating_streams_headroom =
1007
1017
  "{}";
1018
+ const char* const description_header_data_frame =
1019
+ "Managing header and data memory better";
1020
+ const char* const additional_constraints_header_data_frame = "{}";
1008
1021
  const char* const description_inproc_cancel_stream =
1009
1022
  "If set, cancel inproc stream inside the transport mutex.";
1010
1023
  const char* const additional_constraints_inproc_cancel_stream = "{}";
@@ -1238,6 +1251,8 @@ const ExperimentMetadata g_experiment_metadata[] = {
1238
1251
  description_h2_max_deallocating_streams_headroom,
1239
1252
  additional_constraints_h2_max_deallocating_streams_headroom, nullptr, 0,
1240
1253
  false, true},
1254
+ {"header_data_frame", description_header_data_frame,
1255
+ additional_constraints_header_data_frame, nullptr, 0, true, true},
1241
1256
  {"inproc_cancel_stream", description_inproc_cancel_stream,
1242
1257
  additional_constraints_inproc_cancel_stream, nullptr, 0, true, true},
1243
1258
  {"keep_alive_ping_timer_batch", description_keep_alive_ping_timer_batch,
@@ -1250,7 +1265,7 @@ const ExperimentMetadata g_experiment_metadata[] = {
1250
1265
  {"memory_optimization_02", description_memory_optimization_02,
1251
1266
  additional_constraints_memory_optimization_02, nullptr, 0, false, false},
1252
1267
  {"message_size_refactoring", description_message_size_refactoring,
1253
- additional_constraints_message_size_refactoring, nullptr, 0, false, true},
1268
+ additional_constraints_message_size_refactoring, nullptr, 0, true, true},
1254
1269
  {"metadata_outstanding_token_refactor",
1255
1270
  description_metadata_outstanding_token_refactor,
1256
1271
  additional_constraints_metadata_outstanding_token_refactor, nullptr, 0,
@@ -1282,7 +1297,7 @@ const ExperimentMetadata g_experiment_metadata[] = {
1282
1297
  {"ph2_client_server", description_ph2_client_server,
1283
1298
  additional_constraints_ph2_client_server, nullptr, 0, false, true},
1284
1299
  {"ph2_perf_01", description_ph2_perf_01, additional_constraints_ph2_perf_01,
1285
- nullptr, 0, false, true},
1300
+ nullptr, 0, true, true},
1286
1301
  {"ph2_server", description_ph2_server, additional_constraints_ph2_server,
1287
1302
  nullptr, 0, false, true},
1288
1303
  {"pick_first_ignore_empty_updates",
@@ -93,13 +93,16 @@ inline bool IsFailRecvMetadataOnDeadlineExceededEnabled() { return false; }
93
93
  inline bool IsFreeLargeAllocatorEnabled() { return false; }
94
94
  inline bool IsFuseFiltersEnabled() { return false; }
95
95
  inline bool IsH2MaxDeallocatingStreamsHeadroomEnabled() { return false; }
96
+ #define GRPC_EXPERIMENT_IS_INCLUDED_HEADER_DATA_FRAME
97
+ inline bool IsHeaderDataFrameEnabled() { return true; }
96
98
  #define GRPC_EXPERIMENT_IS_INCLUDED_INPROC_CANCEL_STREAM
97
99
  inline bool IsInprocCancelStreamEnabled() { return true; }
98
100
  inline bool IsKeepAlivePingTimerBatchEnabled() { return false; }
99
101
  inline bool IsLocalConnectorSecureEnabled() { return false; }
100
102
  inline bool IsMemoryOptimization01Enabled() { return false; }
101
103
  inline bool IsMemoryOptimization02Enabled() { return false; }
102
- inline bool IsMessageSizeRefactoringEnabled() { return false; }
104
+ #define GRPC_EXPERIMENT_IS_INCLUDED_MESSAGE_SIZE_REFACTORING
105
+ inline bool IsMessageSizeRefactoringEnabled() { return true; }
103
106
  inline bool IsMetadataOutstandingTokenRefactorEnabled() { return false; }
104
107
  inline bool IsMetadataPublishToAppTagEnabled() { return false; }
105
108
  #define GRPC_EXPERIMENT_IS_INCLUDED_MONITORING_EXPERIMENT
@@ -118,7 +121,8 @@ inline bool IsOptimization06Enabled() { return false; }
118
121
  inline bool IsOtelExportTelemetryDomainsEnabled() { return false; }
119
122
  inline bool IsPh2ClientEnabled() { return false; }
120
123
  inline bool IsPh2ClientServerEnabled() { return false; }
121
- inline bool IsPh2Perf01Enabled() { return false; }
124
+ #define GRPC_EXPERIMENT_IS_INCLUDED_PH2_PERF_01
125
+ inline bool IsPh2Perf01Enabled() { return true; }
122
126
  inline bool IsPh2ServerEnabled() { return false; }
123
127
  inline bool IsPickFirstIgnoreEmptyUpdatesEnabled() { return false; }
124
128
  inline bool IsPipelinedReadSecureEndpointEnabled() { return false; }
@@ -185,13 +189,16 @@ inline bool IsFailRecvMetadataOnDeadlineExceededEnabled() { return false; }
185
189
  inline bool IsFreeLargeAllocatorEnabled() { return false; }
186
190
  inline bool IsFuseFiltersEnabled() { return false; }
187
191
  inline bool IsH2MaxDeallocatingStreamsHeadroomEnabled() { return false; }
192
+ #define GRPC_EXPERIMENT_IS_INCLUDED_HEADER_DATA_FRAME
193
+ inline bool IsHeaderDataFrameEnabled() { return true; }
188
194
  #define GRPC_EXPERIMENT_IS_INCLUDED_INPROC_CANCEL_STREAM
189
195
  inline bool IsInprocCancelStreamEnabled() { return true; }
190
196
  inline bool IsKeepAlivePingTimerBatchEnabled() { return false; }
191
197
  inline bool IsLocalConnectorSecureEnabled() { return false; }
192
198
  inline bool IsMemoryOptimization01Enabled() { return false; }
193
199
  inline bool IsMemoryOptimization02Enabled() { return false; }
194
- inline bool IsMessageSizeRefactoringEnabled() { return false; }
200
+ #define GRPC_EXPERIMENT_IS_INCLUDED_MESSAGE_SIZE_REFACTORING
201
+ inline bool IsMessageSizeRefactoringEnabled() { return true; }
195
202
  inline bool IsMetadataOutstandingTokenRefactorEnabled() { return false; }
196
203
  inline bool IsMetadataPublishToAppTagEnabled() { return false; }
197
204
  #define GRPC_EXPERIMENT_IS_INCLUDED_MONITORING_EXPERIMENT
@@ -210,7 +217,8 @@ inline bool IsOptimization06Enabled() { return false; }
210
217
  inline bool IsOtelExportTelemetryDomainsEnabled() { return false; }
211
218
  inline bool IsPh2ClientEnabled() { return false; }
212
219
  inline bool IsPh2ClientServerEnabled() { return false; }
213
- inline bool IsPh2Perf01Enabled() { return false; }
220
+ #define GRPC_EXPERIMENT_IS_INCLUDED_PH2_PERF_01
221
+ inline bool IsPh2Perf01Enabled() { return true; }
214
222
  inline bool IsPh2ServerEnabled() { return false; }
215
223
  inline bool IsPickFirstIgnoreEmptyUpdatesEnabled() { return false; }
216
224
  inline bool IsPipelinedReadSecureEndpointEnabled() { return false; }
@@ -277,13 +285,16 @@ inline bool IsFailRecvMetadataOnDeadlineExceededEnabled() { return false; }
277
285
  inline bool IsFreeLargeAllocatorEnabled() { return false; }
278
286
  inline bool IsFuseFiltersEnabled() { return false; }
279
287
  inline bool IsH2MaxDeallocatingStreamsHeadroomEnabled() { return false; }
288
+ #define GRPC_EXPERIMENT_IS_INCLUDED_HEADER_DATA_FRAME
289
+ inline bool IsHeaderDataFrameEnabled() { return true; }
280
290
  #define GRPC_EXPERIMENT_IS_INCLUDED_INPROC_CANCEL_STREAM
281
291
  inline bool IsInprocCancelStreamEnabled() { return true; }
282
292
  inline bool IsKeepAlivePingTimerBatchEnabled() { return false; }
283
293
  inline bool IsLocalConnectorSecureEnabled() { return false; }
284
294
  inline bool IsMemoryOptimization01Enabled() { return false; }
285
295
  inline bool IsMemoryOptimization02Enabled() { return false; }
286
- inline bool IsMessageSizeRefactoringEnabled() { return false; }
296
+ #define GRPC_EXPERIMENT_IS_INCLUDED_MESSAGE_SIZE_REFACTORING
297
+ inline bool IsMessageSizeRefactoringEnabled() { return true; }
287
298
  inline bool IsMetadataOutstandingTokenRefactorEnabled() { return false; }
288
299
  inline bool IsMetadataPublishToAppTagEnabled() { return false; }
289
300
  #define GRPC_EXPERIMENT_IS_INCLUDED_MONITORING_EXPERIMENT
@@ -302,7 +313,8 @@ inline bool IsOptimization06Enabled() { return false; }
302
313
  inline bool IsOtelExportTelemetryDomainsEnabled() { return false; }
303
314
  inline bool IsPh2ClientEnabled() { return false; }
304
315
  inline bool IsPh2ClientServerEnabled() { return false; }
305
- inline bool IsPh2Perf01Enabled() { return false; }
316
+ #define GRPC_EXPERIMENT_IS_INCLUDED_PH2_PERF_01
317
+ inline bool IsPh2Perf01Enabled() { return true; }
306
318
  inline bool IsPh2ServerEnabled() { return false; }
307
319
  inline bool IsPickFirstIgnoreEmptyUpdatesEnabled() { return false; }
308
320
  inline bool IsPipelinedReadSecureEndpointEnabled() { return false; }
@@ -354,6 +366,7 @@ enum ExperimentIds {
354
366
  kExperimentIdFreeLargeAllocator,
355
367
  kExperimentIdFuseFilters,
356
368
  kExperimentIdH2MaxDeallocatingStreamsHeadroom,
369
+ kExperimentIdHeaderDataFrame,
357
370
  kExperimentIdInprocCancelStream,
358
371
  kExperimentIdKeepAlivePingTimerBatch,
359
372
  kExperimentIdLocalConnectorSecure,
@@ -479,6 +492,10 @@ inline bool IsFuseFiltersEnabled() {
479
492
  inline bool IsH2MaxDeallocatingStreamsHeadroomEnabled() {
480
493
  return IsExperimentEnabled<kExperimentIdH2MaxDeallocatingStreamsHeadroom>();
481
494
  }
495
+ #define GRPC_EXPERIMENT_IS_INCLUDED_HEADER_DATA_FRAME
496
+ inline bool IsHeaderDataFrameEnabled() {
497
+ return IsExperimentEnabled<kExperimentIdHeaderDataFrame>();
498
+ }
482
499
  #define GRPC_EXPERIMENT_IS_INCLUDED_INPROC_CANCEL_STREAM
483
500
  inline bool IsInprocCancelStreamEnabled() {
484
501
  return IsExperimentEnabled<kExperimentIdInprocCancelStream>();
@@ -180,7 +180,9 @@ grpc_call* LegacyChannel::CreateCall(
180
180
  args.authority = std::move(authority);
181
181
  args.send_deadline = deadline;
182
182
  args.registered_method = registered_method;
183
- args.arena_init_function = arena_init_function;
183
+ if (arena_init_function.has_value()) {
184
+ args.arena_init_function.emplace(*arena_init_function);
185
+ }
184
186
  grpc_call* call;
185
187
  GRPC_LOG_IF_ERROR("call_create", grpc_call_create(&args, &call));
186
188
  return call;
@@ -14,5 +14,5 @@
14
14
 
15
15
  # GRPC contains the General RPC module.
16
16
  module GRPC
17
- VERSION = '1.83.0'
17
+ VERSION = '1.83.2'
18
18
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grpc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.83.0
4
+ version: 1.83.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - gRPC Authors
@@ -3981,7 +3981,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
3981
3981
  - !ruby/object:Gem::Version
3982
3982
  version: '0'
3983
3983
  requirements: []
3984
- rubygems_version: 4.0.17
3984
+ rubygems_version: 4.0.23
3985
3985
  specification_version: 4
3986
3986
  summary: GRPC system in Ruby
3987
3987
  test_files: