max_message_length.cc
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2015 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 #include <stdio.h>
20 #include <string.h>
21 
22 #include <grpc/byte_buffer.h>
23 #include <grpc/support/alloc.h>
24 #include <grpc/support/log.h>
25 #include <grpc/support/time.h>
26 
33 
34 static void* tag(intptr_t t) { return reinterpret_cast<void*>(t); }
35 
37  const char* test_name,
38  grpc_channel_args* client_args,
39  grpc_channel_args* server_args) {
41  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
42  // We intentionally do not pass the client and server args to
43  // create_fixture(), since we don't want the limit enforced on the
44  // proxy, only on the backend server.
45  f = config.create_fixture(nullptr, nullptr);
46  config.init_server(&f, server_args);
47  config.init_client(&f, client_args);
48  return f;
49 }
50 
53 }
54 
56  return n_seconds_from_now(5);
57 }
58 
60  grpc_event ev;
61  do {
63  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
64 }
65 
67  if (!f->server) return;
68  grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
70  f->cq, grpc_timeout_seconds_to_deadline(5), nullptr);
72  GPR_ASSERT(ev.tag == tag(1000));
73  grpc_server_destroy(f->server);
74  f->server = nullptr;
75 }
76 
78  if (!f->client) return;
79  grpc_channel_destroy(f->client);
80  f->client = nullptr;
81 }
82 
86 
88  drain_cq(f->cq);
90 }
91 
92 // Test with request larger than the limit.
93 // If send_limit is true, applies send limit on client; otherwise, applies
94 // recv limit on server.
96  bool send_limit,
97  bool use_service_config,
98  bool use_string_json_value) {
100  "testing request with send_limit=%d use_service_config=%d "
101  "use_string_json_value=%d",
102  send_limit, use_service_config, use_string_json_value);
103 
105  grpc_call* c = nullptr;
106  grpc_call* s = nullptr;
107  cq_verifier* cqv;
108  grpc_op ops[6];
109  grpc_op* op;
110  grpc_slice request_payload_slice =
111  grpc_slice_from_copied_string("hello world");
112  grpc_byte_buffer* request_payload =
113  grpc_raw_byte_buffer_create(&request_payload_slice, 1);
114  grpc_byte_buffer* recv_payload = nullptr;
122  int was_cancelled = 2;
123 
124  grpc_channel_args* client_args = nullptr;
125  grpc_channel_args* server_args = nullptr;
126  if (use_service_config) {
127  // We don't currently support service configs on the server side.
128  GPR_ASSERT(send_limit);
129  grpc_arg arg;
131  arg.key = const_cast<char*>(GRPC_ARG_SERVICE_CONFIG);
132  arg.value.string =
133  use_string_json_value
134  ? const_cast<char*>(
135  "{\n"
136  " \"methodConfig\": [ {\n"
137  " \"name\": [\n"
138  " { \"service\": \"service\", \"method\": \"method\" }\n"
139  " ],\n"
140  " \"maxRequestMessageBytes\": \"5\"\n"
141  " } ]\n"
142  "}")
143  : const_cast<char*>(
144  "{\n"
145  " \"methodConfig\": [ {\n"
146  " \"name\": [\n"
147  " { \"service\": \"service\", \"method\": \"method\" }\n"
148  " ],\n"
149  " \"maxRequestMessageBytes\": 5\n"
150  " } ]\n"
151  "}");
152  client_args = grpc_channel_args_copy_and_add(nullptr, &arg, 1);
153  } else {
154  // Set limit via channel args.
155  grpc_arg arg;
156  arg.key = send_limit
157  ? const_cast<char*>(GRPC_ARG_MAX_SEND_MESSAGE_LENGTH)
158  : const_cast<char*>(GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH);
160  arg.value.integer = 5;
162  if (send_limit) {
163  client_args = args;
164  } else {
165  server_args = args;
166  }
167  }
168 
169  f = begin_test(config, "test_max_request_message_length", client_args,
170  server_args);
171  {
173  if (client_args != nullptr) grpc_channel_args_destroy(client_args);
174  if (server_args != nullptr) grpc_channel_args_destroy(server_args);
175  }
176 
177  cqv = cq_verifier_create(f.cq);
178 
179  c = grpc_channel_create_call(f.client, nullptr, GRPC_PROPAGATE_DEFAULTS, f.cq,
180  grpc_slice_from_static_string("/service/method"),
182  nullptr);
183  GPR_ASSERT(c);
184 
189 
190  memset(ops, 0, sizeof(ops));
191  op = ops;
194  op->flags = 0;
195  op->reserved = nullptr;
196  op++;
198  op->data.send_message.send_message = request_payload;
199  op->flags = 0;
200  op->reserved = nullptr;
201  op++;
203  op->flags = 0;
204  op->reserved = nullptr;
205  op++;
208  op->flags = 0;
209  op->reserved = nullptr;
210  op++;
215  op->flags = 0;
216  op->reserved = nullptr;
217  op++;
218  error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1),
219  nullptr);
221 
222  if (send_limit) {
223  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
224  cq_verify(cqv);
225  goto done;
226  }
227 
228  error =
230  &request_metadata_recv, f.cq, f.cq, tag(101));
232  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
233  cq_verify(cqv);
234 
235  memset(ops, 0, sizeof(ops));
236  op = ops;
239  op->flags = 0;
240  op->reserved = nullptr;
241  op++;
243  op->data.recv_message.recv_message = &recv_payload;
244  op->flags = 0;
245  op->reserved = nullptr;
246  op++;
247  error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102),
248  nullptr);
250 
251  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
252  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
253  cq_verify(cqv);
254 
255  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/service/method"));
257 
258 done:
260  GPR_ASSERT(
262  details, send_limit
263  ? "Sent message larger than max (11 vs. 5)"
264  : "Received message larger than max (11 vs. 5)") == 0);
265 
271  grpc_byte_buffer_destroy(request_payload);
272  grpc_byte_buffer_destroy(recv_payload);
273 
275  if (s != nullptr) grpc_call_unref(s);
276 
277  cq_verifier_destroy(cqv);
278 
279  end_test(&f);
280  config.tear_down_data(&f);
281 }
282 
283 // Test with response larger than the limit.
284 // If send_limit is true, applies send limit on server; otherwise, applies
285 // recv limit on client.
287  bool send_limit,
288  bool use_service_config,
289  bool use_string_json_value) {
291  "testing response with send_limit=%d use_service_config=%d "
292  "use_string_json_value=%d",
293  send_limit, use_service_config, use_string_json_value);
294 
296  grpc_call* c = nullptr;
297  grpc_call* s = nullptr;
298  cq_verifier* cqv;
299  grpc_op ops[6];
300  grpc_op* op;
301  grpc_slice response_payload_slice =
302  grpc_slice_from_copied_string("hello world");
303  grpc_byte_buffer* response_payload =
304  grpc_raw_byte_buffer_create(&response_payload_slice, 1);
305  grpc_byte_buffer* recv_payload = nullptr;
313  int was_cancelled = 2;
314 
315  grpc_channel_args* client_args = nullptr;
316  grpc_channel_args* server_args = nullptr;
317  if (use_service_config) {
318  // We don't currently support service configs on the server side.
319  GPR_ASSERT(!send_limit);
320  grpc_arg arg;
322  arg.key = const_cast<char*>(GRPC_ARG_SERVICE_CONFIG);
323  arg.value.string = const_cast<char*>(
324  use_string_json_value
325  ? "{\n"
326  " \"methodConfig\": [ {\n"
327  " \"name\": [\n"
328  " { \"service\": \"service\", \"method\": \"method\" }\n"
329  " ],\n"
330  " \"maxResponseMessageBytes\": \"5\"\n"
331  " } ]\n"
332  "}"
333  : "{\n"
334  " \"methodConfig\": [ {\n"
335  " \"name\": [\n"
336  " { \"service\": \"service\", \"method\": \"method\" }\n"
337  " ],\n"
338  " \"maxResponseMessageBytes\": 5\n"
339  " } ]\n"
340  "}");
341  client_args = grpc_channel_args_copy_and_add(nullptr, &arg, 1);
342  } else {
343  // Set limit via channel args.
344  grpc_arg arg;
345  arg.key = send_limit
346  ? const_cast<char*>(GRPC_ARG_MAX_SEND_MESSAGE_LENGTH)
347  : const_cast<char*>(GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH);
349  arg.value.integer = 5;
351  if (send_limit) {
352  server_args = args;
353  } else {
354  client_args = args;
355  }
356  }
357 
358  f = begin_test(config, "test_max_response_message_length", client_args,
359  server_args);
360  {
362  if (client_args != nullptr) grpc_channel_args_destroy(client_args);
363  if (server_args != nullptr) grpc_channel_args_destroy(server_args);
364  }
365  cqv = cq_verifier_create(f.cq);
366 
367  c = grpc_channel_create_call(f.client, nullptr, GRPC_PROPAGATE_DEFAULTS, f.cq,
368  grpc_slice_from_static_string("/service/method"),
370  nullptr);
371  GPR_ASSERT(c);
372 
377 
378  memset(ops, 0, sizeof(ops));
379  op = ops;
382  op->flags = 0;
383  op->reserved = nullptr;
384  op++;
386  op->flags = 0;
387  op->reserved = nullptr;
388  op++;
391  op->flags = 0;
392  op->reserved = nullptr;
393  op++;
395  op->data.recv_message.recv_message = &recv_payload;
396  op->flags = 0;
397  op->reserved = nullptr;
398  op++;
403  op->flags = 0;
404  op->reserved = nullptr;
405  op++;
406  error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1),
407  nullptr);
409 
410  error =
412  &request_metadata_recv, f.cq, f.cq, tag(101));
414  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
415  cq_verify(cqv);
416 
417  memset(ops, 0, sizeof(ops));
418  op = ops;
421  op->flags = 0;
422  op->reserved = nullptr;
423  op++;
426  op->flags = 0;
427  op->reserved = nullptr;
428  op++;
430  op->data.send_message.send_message = response_payload;
431  op->flags = 0;
432  op->reserved = nullptr;
433  op++;
437  grpc_slice status_details = grpc_slice_from_static_string("xyz");
438  op->data.send_status_from_server.status_details = &status_details;
439  op->flags = 0;
440  op->reserved = nullptr;
441  op++;
442  error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102),
443  nullptr);
445 
446  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
447  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
448  cq_verify(cqv);
449 
450  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/service/method"));
452  GPR_ASSERT(
454  details, send_limit
455  ? "Sent message larger than max (11 vs. 5)"
456  : "Received message larger than max (11 vs. 5)") == 0);
457 
463  grpc_byte_buffer_destroy(response_payload);
464  grpc_byte_buffer_destroy(recv_payload);
465 
467  if (s != nullptr) grpc_call_unref(s);
468  cq_verifier_destroy(cqv);
469  end_test(&f);
470  config.tear_down_data(&f);
471 }
472 
476  grpc_slice_from_static_string("grpc-internal-encoding-request");
481 }
482 
483 // Test receive message limit with compressed request larger than the limit
485  grpc_end2end_test_config config, bool minimal_stack) {
487  "test max receive message length on compressed request with "
488  "minimal_stack=%d",
489  minimal_stack);
491  grpc_call* c = nullptr;
492  grpc_call* s = nullptr;
493  cq_verifier* cqv;
494  grpc_op ops[6];
495  grpc_op* op;
496  grpc_slice request_payload_slice = grpc_slice_malloc(1024);
497  memset(GRPC_SLICE_START_PTR(request_payload_slice), 'a', 1024);
498  grpc_byte_buffer* request_payload =
499  grpc_raw_byte_buffer_create(&request_payload_slice, 1);
500  grpc_byte_buffer* recv_payload = nullptr;
507  grpc_slice details, status_details;
508  int was_cancelled = 2;
509 
510  // Set limit via channel args.
511  grpc_arg arg[2];
513  const_cast<char*>(GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH), 5);
515  const_cast<char*>(GRPC_ARG_MINIMAL_STACK), minimal_stack);
516  grpc_channel_args* server_args =
517  grpc_channel_args_copy_and_add(nullptr, arg, 2);
518 
519  f = begin_test(config, "test_max_request_message_length", nullptr,
520  server_args);
521  {
523  grpc_channel_args_destroy(server_args);
524  }
525  cqv = cq_verifier_create(f.cq);
526  c = grpc_channel_create_call(f.client, nullptr, GRPC_PROPAGATE_DEFAULTS, f.cq,
527  grpc_slice_from_static_string("/service/method"),
529  nullptr);
530  GPR_ASSERT(c);
531 
536 
537  grpc_metadata compression_md = gzip_compression_override();
538  memset(ops, 0, sizeof(ops));
539  op = ops;
542  op->data.send_initial_metadata.metadata = &compression_md;
543  op->flags = 0;
544  op->reserved = nullptr;
545  op++;
547  op->data.send_message.send_message = request_payload;
548  op->flags = 0;
549  op->reserved = nullptr;
550  op++;
552  op->flags = 0;
553  op->reserved = nullptr;
554  op++;
557  op->flags = 0;
558  op->reserved = nullptr;
559  op++;
564  op->flags = 0;
565  op->reserved = nullptr;
566  op++;
567  error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1),
568  nullptr);
570 
571  error =
573  &request_metadata_recv, f.cq, f.cq, tag(101));
575  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
576  cq_verify(cqv);
577 
578  memset(ops, 0, sizeof(ops));
579  op = ops;
582  op->flags = 0;
583  op->reserved = nullptr;
584  op++;
586  op->data.recv_message.recv_message = &recv_payload;
587  op->flags = 0;
588  op->reserved = nullptr;
589  op++;
590  if (minimal_stack) {
591  /* Expect the RPC to proceed normally for a minimal stack */
594  op->flags = 0;
595  op->reserved = nullptr;
596  op++;
600  status_details = grpc_slice_from_static_string("xyz");
601  op->data.send_status_from_server.status_details = &status_details;
602  op->flags = 0;
603  op->reserved = nullptr;
604  op++;
605  }
606  error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102),
607  nullptr);
609 
610  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
611  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
612  cq_verify(cqv);
613 
614  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/service/method"));
615  if (minimal_stack) {
616  /* We do not perform message size checks for minimal stack. */
618  } else {
622  details, "Received message larger than max (29 vs. 5)") ==
623  0);
624  }
626  grpc_slice_unref(request_payload_slice);
631  grpc_byte_buffer_destroy(request_payload);
632  grpc_byte_buffer_destroy(recv_payload);
634  if (s != nullptr) grpc_call_unref(s);
635  cq_verifier_destroy(cqv);
636 
637  end_test(&f);
638  config.tear_down_data(&f);
639 }
640 
641 // Test receive message limit with compressed response larger than the limit.
643  grpc_end2end_test_config config, bool minimal_stack) {
645  "testing max receive message length on compressed response with "
646  "minimal_stack=%d",
647  minimal_stack);
649  grpc_call* c = nullptr;
650  grpc_call* s = nullptr;
651  cq_verifier* cqv;
652  grpc_op ops[6];
653  grpc_op* op;
654  grpc_slice response_payload_slice = grpc_slice_malloc(1024);
655  memset(GRPC_SLICE_START_PTR(response_payload_slice), 'a', 1024);
656  grpc_byte_buffer* response_payload =
657  grpc_raw_byte_buffer_create(&response_payload_slice, 1);
658  grpc_byte_buffer* recv_payload = nullptr;
666  int was_cancelled = 2;
667 
668  // Set limit via channel args.
669  grpc_arg arg[2];
671  const_cast<char*>(GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH), 5);
673  const_cast<char*>(GRPC_ARG_MINIMAL_STACK), minimal_stack);
674  grpc_channel_args* client_args =
675  grpc_channel_args_copy_and_add(nullptr, arg, 2);
676 
677  f = begin_test(config, "test_max_response_message_length", client_args,
678  nullptr);
679  {
681  grpc_channel_args_destroy(client_args);
682  }
683  cqv = cq_verifier_create(f.cq);
684 
685  c = grpc_channel_create_call(f.client, nullptr, GRPC_PROPAGATE_DEFAULTS, f.cq,
686  grpc_slice_from_static_string("/service/method"),
688  nullptr);
689  GPR_ASSERT(c);
690 
695 
696  memset(ops, 0, sizeof(ops));
697  op = ops;
700  op->flags = 0;
701  op->reserved = nullptr;
702  op++;
704  op->flags = 0;
705  op->reserved = nullptr;
706  op++;
709  op->flags = 0;
710  op->reserved = nullptr;
711  op++;
713  op->data.recv_message.recv_message = &recv_payload;
714  op->flags = 0;
715  op->reserved = nullptr;
716  op++;
721  op->flags = 0;
722  op->reserved = nullptr;
723  op++;
724  error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1),
725  nullptr);
727 
728  error =
730  &request_metadata_recv, f.cq, f.cq, tag(101));
732  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
733  cq_verify(cqv);
734 
735  grpc_metadata compression_md = gzip_compression_override();
736  memset(ops, 0, sizeof(ops));
737  op = ops;
740  op->data.send_initial_metadata.metadata = &compression_md;
741  op->flags = 0;
742  op->reserved = nullptr;
743  op++;
746  op->flags = 0;
747  op->reserved = nullptr;
748  op++;
750  op->data.send_message.send_message = response_payload;
751  op->flags = 0;
752  op->reserved = nullptr;
753  op++;
757  grpc_slice status_details = grpc_slice_from_static_string("xyz");
758  op->data.send_status_from_server.status_details = &status_details;
759  op->flags = 0;
760  op->reserved = nullptr;
761  op++;
762  error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102),
763  nullptr);
765 
766  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
767  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
768  cq_verify(cqv);
769 
770  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/service/method"));
771  if (minimal_stack) {
772  /* We do not perform message size checks for minimal stack. */
774  } else {
777  details, "Received message larger than max (29 vs. 5)") ==
778  0);
779  }
781  grpc_slice_unref(response_payload_slice);
786  grpc_byte_buffer_destroy(response_payload);
787  grpc_byte_buffer_destroy(recv_payload);
788 
790  if (s != nullptr) grpc_call_unref(s);
791 
792  cq_verifier_destroy(cqv);
793 
794  end_test(&f);
795  config.tear_down_data(&f);
796 }
797 
799  test_max_message_length_on_request(config, false /* send_limit */,
800  false /* use_service_config */,
801  false /* use_string_json_value */);
802  test_max_message_length_on_request(config, true /* send_limit */,
803  false /* use_service_config */,
804  false /* use_string_json_value */);
805  test_max_message_length_on_response(config, false /* send_limit */,
806  false /* use_service_config */,
807  false /* use_string_json_value */);
808  test_max_message_length_on_response(config, true /* send_limit */,
809  false /* use_service_config */,
810  false /* use_string_json_value */);
811  test_max_message_length_on_request(config, true /* send_limit */,
812  true /* use_service_config */,
813  false /* use_string_json_value */);
814  test_max_message_length_on_request(config, true /* send_limit */,
815  true /* use_service_config */,
816  true /* use_string_json_value */);
817  test_max_message_length_on_response(config, false /* send_limit */,
818  true /* use_service_config */,
819  false /* use_string_json_value */);
820  test_max_message_length_on_response(config, false /* send_limit */,
821  true /* use_service_config */,
822  true /* use_string_json_value */);
823  /* The following tests are not useful for inproc transport and do not work
824  * with our simple proxy. */
825  if (strcmp(config.name, "inproc") != 0 &&
826  (config.feature_mask & FEATURE_MASK_SUPPORTS_REQUEST_PROXYING) == 0) {
831  }
832 }
833 
grpc_arg
Definition: grpc_types.h:103
grpc_slice_unref
GPRAPI void grpc_slice_unref(grpc_slice s)
Definition: slice_api.cc:32
GPR_INFO
#define GPR_INFO
Definition: include/grpc/impl/codegen/log.h:56
grpc_op::grpc_op_data::grpc_op_send_message::send_message
struct grpc_byte_buffer * send_message
Definition: grpc_types.h:668
grpc_op::flags
uint32_t flags
Definition: grpc_types.h:644
grpc_call_error
grpc_call_error
Definition: grpc_types.h:464
grpc_call_details_destroy
GRPCAPI void grpc_call_details_destroy(grpc_call_details *details)
Definition: call_details.cc:36
grpc_call_details_init
GRPCAPI void grpc_call_details_init(grpc_call_details *details)
Definition: call_details.cc:30
grpc_op::grpc_op_data::grpc_op_recv_status_on_client::trailing_metadata
grpc_metadata_array * trailing_metadata
Definition: grpc_types.h:701
grpc_timeout_seconds_to_deadline
gpr_timespec grpc_timeout_seconds_to_deadline(int64_t time_s)
Definition: test/core/util/test_config.cc:81
log.h
grpc_op::grpc_op_data::grpc_op_recv_status_on_client::status
grpc_status_code * status
Definition: grpc_types.h:702
grpc_raw_byte_buffer_create
GRPCAPI grpc_byte_buffer * grpc_raw_byte_buffer_create(grpc_slice *slices, size_t nslices)
Definition: byte_buffer.cc:34
test_max_receive_message_length_on_compressed_request
static void test_max_receive_message_length_on_compressed_request(grpc_end2end_test_config config, bool minimal_stack)
Definition: max_message_length.cc:484
test_max_message_length_on_response
static void test_max_message_length_on_response(grpc_end2end_test_config config, bool send_limit, bool use_service_config, bool use_string_json_value)
Definition: max_message_length.cc:286
GRPC_ARG_INTEGER
@ GRPC_ARG_INTEGER
Definition: grpc_types.h:81
memset
return memset(p, 0, total)
GRPC_ARG_STRING
@ GRPC_ARG_STRING
Definition: grpc_types.h:80
grpc_slice_from_copied_string
GPRAPI grpc_slice grpc_slice_from_copied_string(const char *source)
Definition: slice/slice.cc:177
grpc_op::grpc_op_data::send_initial_metadata
struct grpc_op::grpc_op_data::grpc_op_send_initial_metadata send_initial_metadata
GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH
#define GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH
Definition: grpc_types.h:153
grpc_metadata_array
Definition: grpc_types.h:579
n_seconds_from_now
static gpr_timespec n_seconds_from_now(int n)
Definition: max_message_length.cc:51
grpc_call_details
Definition: grpc_types.h:585
grpc_op::reserved
void * reserved
Definition: grpc_types.h:646
string.h
error
grpc_error_handle error
Definition: retry_filter.cc:499
grpc_status_code
grpc_status_code
Definition: include/grpc/impl/codegen/status.h:28
GRPC_QUEUE_SHUTDOWN
@ GRPC_QUEUE_SHUTDOWN
Definition: grpc_types.h:554
GRPC_OP_COMPLETE
@ GRPC_OP_COMPLETE
Definition: grpc_types.h:558
arg::value
void * value
Definition: cmdline.cc:44
GRPC_CALL_OK
@ GRPC_CALL_OK
Definition: grpc_types.h:466
status
absl::Status status
Definition: rls.cc:251
gpr_inf_future
GPRAPI gpr_timespec gpr_inf_future(gpr_clock_type type)
Definition: src/core/lib/gpr/time.cc:55
time.h
end_test
static void end_test(grpc_end2end_test_fixture *f)
Definition: max_message_length.cc:83
grpc_call_details::method
grpc_slice method
Definition: grpc_types.h:586
grpc_end2end_test_config
Definition: end2end_tests.h:53
GRPC_ARG_MAX_SEND_MESSAGE_LENGTH
#define GRPC_ARG_MAX_SEND_MESSAGE_LENGTH
Definition: grpc_types.h:159
GRPC_STATUS_RESOURCE_EXHAUSTED
@ GRPC_STATUS_RESOURCE_EXHAUSTED
Definition: include/grpc/impl/codegen/status.h:76
grpc_slice_malloc
GPRAPI grpc_slice grpc_slice_malloc(size_t length)
Definition: slice/slice.cc:227
grpc_channel_args
Definition: grpc_types.h:132
grpc_op::grpc_op_data::recv_message
struct grpc_op::grpc_op_data::grpc_op_recv_message recv_message
grpc_op::data
union grpc_op::grpc_op_data data
grpc_end2end_test_fixture
Definition: end2end_tests.h:46
grpc_metadata_array_destroy
GRPCAPI void grpc_metadata_array_destroy(grpc_metadata_array *array)
Definition: metadata_array.cc:35
grpc_op::grpc_op_data::grpc_op_recv_message::recv_message
struct grpc_byte_buffer ** recv_message
Definition: grpc_types.h:693
grpc_server_request_call
GRPCAPI grpc_call_error grpc_server_request_call(grpc_server *server, grpc_call **call, grpc_call_details *details, grpc_metadata_array *request_metadata, grpc_completion_queue *cq_bound_to_call, grpc_completion_queue *cq_for_notification, void *tag_new)
Definition: src/core/lib/surface/server.cc:1526
trailing_metadata_recv
static grpc_metadata_array trailing_metadata_recv
Definition: test/core/fling/client.cc:43
grpc_metadata
Definition: grpc_types.h:537
c
void c(T a)
Definition: miscompile_with_no_unique_address_test.cc:40
arg::type
argtype type
Definition: cmdline.cc:43
autogen_x86imm.f
f
Definition: autogen_x86imm.py:9
asyncio_get_stats.args
args
Definition: asyncio_get_stats.py:40
GRPC_STATUS_OK
@ GRPC_STATUS_OK
Definition: include/grpc/impl/codegen/status.h:30
GRPC_OP_RECV_INITIAL_METADATA
@ GRPC_OP_RECV_INITIAL_METADATA
Definition: grpc_types.h:617
grpc_metadata::internal_data
struct grpc_metadata::@1 internal_data
GPR_ASSERT
#define GPR_ASSERT(x)
Definition: include/grpc/impl/codegen/log.h:94
GRPC_OP_SEND_STATUS_FROM_SERVER
@ GRPC_OP_SEND_STATUS_FROM_SERVER
Definition: grpc_types.h:612
FEATURE_MASK_SUPPORTS_REQUEST_PROXYING
#define FEATURE_MASK_SUPPORTS_REQUEST_PROXYING
Definition: end2end_tests.h:36
grpc_call_unref
GRPCAPI void grpc_call_unref(grpc_call *call)
Definition: call.cc:1770
grpc_op::grpc_op_data::grpc_op_send_status_from_server::status
grpc_status_code status
Definition: grpc_types.h:673
max_message_length_pre_init
void max_message_length_pre_init(void)
Definition: max_message_length.cc:834
gpr_log
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
grpc_event
Definition: grpc_types.h:564
grpc_completion_queue
Definition: completion_queue.cc:347
cq_verifier_destroy
void cq_verifier_destroy(cq_verifier *v)
Definition: cq_verifier.cc:92
grpc_metadata::value
grpc_slice value
Definition: grpc_types.h:541
grpc_call
struct grpc_call grpc_call
Definition: grpc_types.h:70
grpc_byte_buffer
Definition: grpc_types.h:43
done
struct tab * done
Definition: bloaty/third_party/zlib/examples/enough.c:176
grpc_op
Definition: grpc_types.h:640
GRPC_OP_SEND_MESSAGE
@ GRPC_OP_SEND_MESSAGE
Definition: grpc_types.h:602
GRPC_SLICE_START_PTR
#define GRPC_SLICE_START_PTR(slice)
Definition: include/grpc/impl/codegen/slice.h:101
grpc_channel_args_destroy
void grpc_channel_args_destroy(grpc_channel_args *a)
Definition: channel_args.cc:360
arg
Definition: cmdline.cc:40
grpc_slice_from_static_string
GPRAPI grpc_slice grpc_slice_from_static_string(const char *source)
Definition: slice/slice.cc:89
cq_verifier_create
cq_verifier * cq_verifier_create(grpc_completion_queue *cq)
Definition: cq_verifier.cc:86
was_cancelled
static int was_cancelled
Definition: test/core/fling/server.cc:58
grpc_slice
Definition: include/grpc/impl/codegen/slice.h:65
max_message_length
void max_message_length(grpc_end2end_test_config config)
Definition: max_message_length.cc:798
intptr_t
_W64 signed int intptr_t
Definition: stdint-msvc2008.h:118
cq_verifier
Definition: cq_verifier.cc:76
request_metadata_recv
static grpc_metadata_array request_metadata_recv
Definition: test/core/fling/server.cc:48
grpc_server_destroy
GRPCAPI void grpc_server_destroy(grpc_server *server)
Definition: src/core/lib/surface/server.cc:1519
CQ_EXPECT_COMPLETION
#define CQ_EXPECT_COMPLETION(v, tag, success)
Definition: cq_verifier.h:58
slice_internal.h
end2end_tests.h
test_max_message_length_on_request
static void test_max_message_length_on_request(grpc_end2end_test_config config, bool send_limit, bool use_service_config, bool use_string_json_value)
Definition: max_message_length.cc:95
grpc_core::ExecCtx
Definition: exec_ctx.h:97
n
int n
Definition: abseil-cpp/absl/container/btree_test.cc:1080
grpc_op::op
grpc_op_type op
Definition: grpc_types.h:642
grpc_op::grpc_op_data::grpc_op_send_initial_metadata::count
size_t count
Definition: grpc_types.h:653
grpc_op::grpc_op_data::grpc_op_recv_status_on_client::status_details
grpc_slice * status_details
Definition: grpc_types.h:703
drain_cq
static void drain_cq(grpc_completion_queue *cq)
Definition: max_message_length.cc:59
details
static grpc_slice details
Definition: test/core/fling/client.cc:46
grpc_channel_create_call
GRPCAPI grpc_call * grpc_channel_create_call(grpc_channel *channel, grpc_call *parent_call, uint32_t propagation_mask, grpc_completion_queue *completion_queue, grpc_slice method, const grpc_slice *host, gpr_timespec deadline, void *reserved)
Definition: channel.cc:311
grpc_op::grpc_op_data::recv_close_on_server
struct grpc_op::grpc_op_data::grpc_op_recv_close_on_server recv_close_on_server
GRPC_OP_RECV_MESSAGE
@ GRPC_OP_RECV_MESSAGE
Definition: grpc_types.h:621
begin_test
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, const char *test_name, grpc_channel_args *client_args, grpc_channel_args *server_args)
Definition: max_message_length.cc:36
GRPC_PROPAGATE_DEFAULTS
#define GRPC_PROPAGATE_DEFAULTS
Definition: propagation_bits.h:45
grpc_op::grpc_op_data::send_status_from_server
struct grpc_op::grpc_op_data::grpc_op_send_status_from_server send_status_from_server
grpc_channel_arg_integer_create
grpc_arg grpc_channel_arg_integer_create(char *name, int value)
Definition: channel_args.cc:484
cq_verifier.h
tag
static void * tag(intptr_t t)
Definition: max_message_length.cc:34
shutdown_server
static void shutdown_server(grpc_end2end_test_fixture *f)
Definition: max_message_length.cc:66
GRPC_ARG_SERVICE_CONFIG
#define GRPC_ARG_SERVICE_CONFIG
Definition: grpc_types.h:304
grpc_completion_queue_destroy
GRPCAPI void grpc_completion_queue_destroy(grpc_completion_queue *cq)
Definition: completion_queue.cc:1424
GRPC_OP_SEND_INITIAL_METADATA
@ GRPC_OP_SEND_INITIAL_METADATA
Definition: grpc_types.h:598
gzip_compression_override
static grpc_metadata gzip_compression_override()
Definition: max_message_length.cc:473
exec_ctx
grpc_core::ExecCtx exec_ctx
Definition: end2end_binder_transport_test.cc:75
grpc_op::grpc_op_data::send_message
struct grpc_op::grpc_op_data::grpc_op_send_message send_message
alloc.h
grpc_op::grpc_op_data::grpc_op_send_initial_metadata::metadata
grpc_metadata * metadata
Definition: grpc_types.h:654
grpc_op::grpc_op_data::recv_status_on_client
struct grpc_op::grpc_op_data::grpc_op_recv_status_on_client recv_status_on_client
grpc_op::grpc_op_data::grpc_op_send_status_from_server::trailing_metadata_count
size_t trailing_metadata_count
Definition: grpc_types.h:671
GRPC_ARG_MINIMAL_STACK
#define GRPC_ARG_MINIMAL_STACK
Definition: grpc_types.h:147
grpc_server_shutdown_and_notify
GRPCAPI void grpc_server_shutdown_and_notify(grpc_server *server, grpc_completion_queue *cq, void *tag)
Definition: src/core/lib/surface/server.cc:1503
grpc_byte_buffer_destroy
GRPCAPI void grpc_byte_buffer_destroy(grpc_byte_buffer *bb)
Definition: byte_buffer.cc:81
grpc_completion_queue_next
GRPCAPI grpc_event grpc_completion_queue_next(grpc_completion_queue *cq, gpr_timespec deadline, void *reserved)
Definition: completion_queue.cc:1133
cq_verify
void cq_verify(cq_verifier *v, int timeout_sec)
Definition: cq_verifier.cc:268
grpc_completion_queue_shutdown
GRPCAPI void grpc_completion_queue_shutdown(grpc_completion_queue *cq)
Definition: completion_queue.cc:1416
arg
struct arg arg
grpc_channel_destroy
GRPCAPI void grpc_channel_destroy(grpc_channel *channel)
Definition: channel.cc:437
exec_ctx.h
shutdown_client
static void shutdown_client(grpc_end2end_test_fixture *f)
Definition: max_message_length.cc:77
five_seconds_from_now
static gpr_timespec five_seconds_from_now(void)
Definition: max_message_length.cc:55
config_s
Definition: bloaty/third_party/zlib/deflate.c:120
GRPC_OP_RECV_CLOSE_ON_SERVER
@ GRPC_OP_RECV_CLOSE_ON_SERVER
Definition: grpc_types.h:633
channel_args.h
grpc_op::grpc_op_data::recv_initial_metadata
struct grpc_op::grpc_op_data::grpc_op_recv_initial_metadata recv_initial_metadata
grpc_op::grpc_op_data::grpc_op_send_status_from_server::status_details
grpc_slice * status_details
Definition: grpc_types.h:677
gpr_timespec
Definition: gpr_types.h:50
test_max_receive_message_length_on_compressed_response
static void test_max_receive_message_length_on_compressed_response(grpc_end2end_test_config config, bool minimal_stack)
Definition: max_message_length.cc:642
grpc_event::type
grpc_completion_type type
Definition: grpc_types.h:566
GRPC_OP_RECV_STATUS_ON_CLIENT
@ GRPC_OP_RECV_STATUS_ON_CLIENT
Definition: grpc_types.h:627
grpc_op::grpc_op_data::grpc_op_recv_initial_metadata::recv_initial_metadata
grpc_metadata_array * recv_initial_metadata
Definition: grpc_types.h:685
GPR_CLOCK_REALTIME
@ GPR_CLOCK_REALTIME
Definition: gpr_types.h:39
grpc_slice_str_cmp
GPRAPI int grpc_slice_str_cmp(grpc_slice a, const char *b)
Definition: slice/slice.cc:426
op
static grpc_op * op
Definition: test/core/fling/client.cc:47
ops
static grpc_op ops[6]
Definition: test/core/fling/client.cc:39
initial_metadata_recv
static grpc_metadata_array initial_metadata_recv
Definition: test/core/fling/client.cc:42
grpc_call_start_batch
GRPCAPI grpc_call_error grpc_call_start_batch(grpc_call *call, const grpc_op *ops, size_t nops, void *tag, void *reserved)
Definition: call.cc:1831
grpc_event::tag
void * tag
Definition: grpc_types.h:576
grpc_op::grpc_op_data::grpc_op_recv_close_on_server::cancelled
int * cancelled
Definition: grpc_types.h:714
cq
static grpc_completion_queue * cq
Definition: test/core/fling/client.cc:37
grpc_metadata::key
grpc_slice key
Definition: grpc_types.h:540
grpc_channel_args_copy_and_add
grpc_channel_args * grpc_channel_args_copy_and_add(const grpc_channel_args *src, const grpc_arg *to_add, size_t num_to_add)
Definition: channel_args.cc:224
GRPC_OP_SEND_CLOSE_FROM_CLIENT
@ GRPC_OP_SEND_CLOSE_FROM_CLIENT
Definition: grpc_types.h:607
slice_string_helpers.h
call_details
static grpc_call_details call_details
Definition: test/core/fling/server.cc:47
grpc_metadata_array_init
GRPCAPI void grpc_metadata_array_init(grpc_metadata_array *array)
Definition: metadata_array.cc:30


grpc
Author(s):
autogenerated on Fri May 16 2025 02:59:23