httpcli_test.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 
20 
21 #include <string.h>
22 
23 #include <gmock/gmock.h>
24 #include <gtest/gtest.h>
25 
26 #include "absl/strings/str_format.h"
27 
28 #include <grpc/grpc.h>
29 #include <grpc/grpc_security.h>
30 #include <grpc/support/alloc.h>
31 #include <grpc/support/log.h>
33 #include <grpc/support/sync.h>
34 
42 #include "test/core/util/port.h"
45 
46 namespace {
47 
48 grpc_core::Timestamp NSecondsTime(int seconds) {
51 }
52 
53 absl::Time AbslDeadlineSeconds(int s) {
55 }
56 
57 int g_argc;
58 char** g_argv;
59 int g_server_port;
61 
62 class HttpRequestTest : public ::testing::Test {
63  public:
64  HttpRequestTest() {
65  grpc_init();
67  grpc_pollset* pollset =
68  static_cast<grpc_pollset*>(gpr_zalloc(grpc_pollset_size()));
69  grpc_pollset_init(pollset, &mu_);
71  }
72  ~HttpRequestTest() override {
73  {
77  GRPC_CLOSURE_CREATE(DestroyPops, &pops_, grpc_schedule_on_exec_ctx));
78  }
79  grpc_shutdown();
80  }
81 
82  void RunAndKick(const std::function<void()>& f) {
84  f();
86  "pollset_kick",
88  }
89 
90  void PollUntil(const std::function<bool()>& predicate, absl::Time deadline) {
92  while (!predicate()) {
93  GPR_ASSERT(absl::Now() < deadline);
94  grpc_pollset_worker* worker = nullptr;
96  "pollset_work", grpc_pollset_work(grpc_polling_entity_pollset(&pops_),
97  &worker, NSecondsTime(1))));
100  }
102  }
103 
104  grpc_polling_entity* pops() { return &pops_; }
105 
106  protected:
107  static void SetUpTestSuite() {
109  g_argc, g_argv, false /* use_ssl */);
110  g_server = test_server.server;
111  g_server_port = test_server.port;
112  }
113 
115 
116  private:
117  static void DestroyPops(void* p, grpc_error_handle /*error*/) {
118  grpc_polling_entity* pops = static_cast<grpc_polling_entity*>(p);
121  }
122 
123  gpr_mu* mu_;
124  grpc_polling_entity pops_;
125 };
126 
127 struct RequestState {
128  explicit RequestState(HttpRequestTest* test) : test(test) {}
129 
130  ~RequestState() {
133  }
134 
135  HttpRequestTest* test;
136  bool done = false;
138  grpc_pollset_set* pollset_set_to_destroy_eagerly = nullptr;
139 };
140 
141 void OnFinish(void* arg, grpc_error_handle error) {
142  RequestState* request_state = static_cast<RequestState*>(arg);
143  if (request_state->pollset_set_to_destroy_eagerly != nullptr) {
144  // Destroy the request's polling entity param. The goal is to try to catch a
145  // bug where we might still be referencing the polling entity by
146  // a pending TCP connect.
147  grpc_pollset_set_destroy(request_state->pollset_set_to_destroy_eagerly);
148  }
149  const char* expect =
150  "<html><head><title>Hello world!</title></head>"
151  "<body><p>This is a test</p></body></html>";
153  grpc_http_response response = request_state->response;
154  gpr_log(GPR_INFO, "response status=%d error=%s", response.status,
156  GPR_ASSERT(response.status == 200);
157  GPR_ASSERT(response.body_length == strlen(expect));
158  GPR_ASSERT(0 == memcmp(expect, response.body, response.body_length));
159  request_state->test->RunAndKick(
160  [request_state]() { request_state->done = true; });
161 }
162 
163 void OnFinishExpectFailure(void* arg, grpc_error_handle error) {
164  RequestState* request_state = static_cast<RequestState*>(arg);
165  if (request_state->pollset_set_to_destroy_eagerly != nullptr) {
166  // Destroy the request's polling entity param. The goal is to try to catch a
167  // bug where we might still be referencing the polling entity by
168  // a pending TCP connect.
169  grpc_pollset_set_destroy(request_state->pollset_set_to_destroy_eagerly);
170  }
171  grpc_http_response response = request_state->response;
172  gpr_log(GPR_INFO, "response status=%d error=%s", response.status,
175  request_state->test->RunAndKick(
176  [request_state]() { request_state->done = true; });
177 }
178 
179 TEST_F(HttpRequestTest, Get) {
180  RequestState request_state(this);
183  std::string host = absl::StrFormat("localhost:%d", g_server_port);
184  gpr_log(GPR_INFO, "requesting from %s", host.c_str());
185  memset(&req, 0, sizeof(req));
186  auto uri = grpc_core::URI::Create("http", host, "/get", {} /* query params */,
187  "" /* fragment */);
188  GPR_ASSERT(uri.ok());
191  std::move(*uri), nullptr /* channel args */, pops(), &req,
192  NSecondsTime(15),
193  GRPC_CLOSURE_CREATE(OnFinish, &request_state,
194  grpc_schedule_on_exec_ctx),
195  &request_state.response,
198  http_request->Start();
199  PollUntil([&request_state]() { return request_state.done; },
200  AbslDeadlineSeconds(60));
201 }
202 
203 TEST_F(HttpRequestTest, Post) {
204  RequestState request_state(this);
207  std::string host = absl::StrFormat("localhost:%d", g_server_port);
208  gpr_log(GPR_INFO, "posting to %s", host.c_str());
209  memset(&req, 0, sizeof(req));
210  req.body = const_cast<char*>("hello");
211  req.body_length = 5;
212  auto uri = grpc_core::URI::Create("http", host, "/post",
213  {} /* query params */, "" /* fragment */);
214  GPR_ASSERT(uri.ok());
217  std::move(*uri), nullptr /* channel args */, pops(), &req,
218  NSecondsTime(15),
219  GRPC_CLOSURE_CREATE(OnFinish, &request_state,
220  grpc_schedule_on_exec_ctx),
221  &request_state.response,
224  http_request->Start();
225  PollUntil([&request_state]() { return request_state.done; },
226  AbslDeadlineSeconds(60));
227 }
228 
229 int g_fake_non_responsive_dns_server_port;
230 
231 void InjectNonResponsiveDNSServer(ares_channel channel) {
233  "Injecting broken nameserver list. Bad server address:|[::1]:%d|.",
234  g_fake_non_responsive_dns_server_port);
235  // Configure a non-responsive DNS server at the front of c-ares's nameserver
236  // list.
237  struct ares_addr_port_node dns_server_addrs[1];
238  dns_server_addrs[0].family = AF_INET6;
239  (reinterpret_cast<char*>(&dns_server_addrs[0].addr.addr6))[15] = 0x1;
240  dns_server_addrs[0].tcp_port = g_fake_non_responsive_dns_server_port;
241  dns_server_addrs[0].udp_port = g_fake_non_responsive_dns_server_port;
242  dns_server_addrs[0].next = nullptr;
243  GPR_ASSERT(ares_set_servers_ports(channel, dns_server_addrs) == ARES_SUCCESS);
244 }
245 
246 TEST_F(HttpRequestTest, CancelGetDuringDNSResolution) {
247  // Inject an unresponsive DNS server into the resolver's DNS server config
250  kWaitForClientToSendFirstBytes,
252  g_fake_non_responsive_dns_server_port = fake_dns_server.port();
253  void (*prev_test_only_inject_config)(ares_channel channel) =
255  grpc_ares_test_only_inject_config = InjectNonResponsiveDNSServer;
256  // Run the same test on several threads in parallel to try to trigger races
257  // etc.
258  int kNumThreads = 100;
259  std::vector<std::thread> threads;
260  threads.reserve(kNumThreads);
261  for (int i = 0; i < kNumThreads; i++) {
262  threads.push_back(std::thread([this]() {
263  RequestState request_state(this);
266  memset(&req, 0, sizeof(grpc_http_request));
267  auto uri = grpc_core::URI::Create(
268  "http", "dont-care-since-wont-be-resolved.test.com:443", "/get",
269  {} /* query params */, "" /* fragment */);
270  GPR_ASSERT(uri.ok());
273  std::move(*uri), nullptr /* channel args */, pops(), &req,
274  NSecondsTime(120),
275  GRPC_CLOSURE_CREATE(OnFinishExpectFailure, &request_state,
276  grpc_schedule_on_exec_ctx),
277  &request_state.response,
280  http_request->Start();
281  std::thread cancel_thread([&http_request]() {
284  http_request.reset();
285  });
286  // Poll with a deadline explicitly lower than the request timeout, so
287  // that we know that the request timeout isn't just kicking in.
288  PollUntil([&request_state]() { return request_state.done; },
289  AbslDeadlineSeconds(60));
290  cancel_thread.join();
291  }));
292  }
293  for (auto& t : threads) {
294  t.join();
295  }
296  grpc_ares_test_only_inject_config = prev_test_only_inject_config;
297 }
298 
299 TEST_F(HttpRequestTest, CancelGetWhileReadingResponse) {
300  // Start up a fake HTTP server which just accepts connections
301  // and then hangs, i.e. does not send back any bytes to the client.
302  // The goal here is to get the client to connect to this fake server
303  // and send a request, and then sit waiting for a response. Then, a
304  // separate thread will cancel the HTTP request, and that should let it
305  // complete.
308  kWaitForClientToSendFirstBytes,
310  // Run the same test on several threads in parallel to try to trigger races
311  // etc.
312  int kNumThreads = 100;
313  std::vector<std::thread> threads;
314  threads.reserve(kNumThreads);
315  for (int i = 0; i < kNumThreads; i++) {
316  grpc_core::testing::FakeUdpAndTcpServer* fake_http_server_ptr =
317  &fake_http_server;
318  threads.push_back(std::thread([this, fake_http_server_ptr]() {
319  RequestState request_state(this);
322  memset(&req, 0, sizeof(req));
323  auto uri = grpc_core::URI::Create("http", fake_http_server_ptr->address(),
324  "/get", {} /* query params */,
325  "" /* fragment */);
326  GPR_ASSERT(uri.ok());
329  std::move(*uri), nullptr /* channel args */, pops(), &req,
330  NSecondsTime(120),
331  GRPC_CLOSURE_CREATE(OnFinishExpectFailure, &request_state,
332  grpc_schedule_on_exec_ctx),
333  &request_state.response,
336  http_request->Start();
337  exec_ctx.Flush();
338  std::thread cancel_thread([&http_request]() {
341  http_request.reset();
342  });
343  // Poll with a deadline explicitly lower than the request timeout, so
344  // that we know that the request timeout isn't just kicking in.
345  PollUntil([&request_state]() { return request_state.done; },
346  AbslDeadlineSeconds(60));
347  cancel_thread.join();
348  }));
349  }
350  for (auto& t : threads) {
351  t.join();
352  }
353 }
354 
355 // The main point of this test is just to exercise the machinery around
356 // cancellation during TCP connection establishment, to make sure there are no
357 // crashes/races etc. This test doesn't actually verify that cancellation during
358 // TCP setup is happening, though. For that, we would need to induce packet loss
359 // in the test.
360 TEST_F(HttpRequestTest, CancelGetRacesWithConnectionFailure) {
361  // Grab an unoccupied port but don't listen on it. The goal
362  // here is just to have a server address that will reject
363  // TCP connection setups.
364  // Note that because the server is rejecting TCP connections, we
365  // don't really need to cancel the HTTP requests in this test case
366  // in order for them proceeed i.e. in order for them to pass. The test
367  // is still beneficial though because it can exercise the same code paths
368  // that would get taken if the HTTP request was cancelled while the TCP
369  // connect attempt was actually hanging.
370  int fake_server_port = grpc_pick_unused_port_or_die();
371  std::string fake_server_address =
372  absl::StrCat("[::1]:", std::to_string(fake_server_port));
373  // Run the same test on several threads in parallel to try to trigger races
374  // etc.
375  int kNumThreads = 100;
376  std::vector<std::thread> threads;
377  threads.reserve(kNumThreads);
378  for (int i = 0; i < kNumThreads; i++) {
379  threads.push_back(std::thread([this, fake_server_address]() {
380  RequestState request_state(this);
383  memset(&req, 0, sizeof(req));
384  auto uri =
385  grpc_core::URI::Create("http", fake_server_address, "/get",
386  {} /* query params */, "" /* fragment */);
387  GPR_ASSERT(uri.ok());
390  std::move(*uri), nullptr /* channel args */, pops(), &req,
391  NSecondsTime(120),
392  GRPC_CLOSURE_CREATE(OnFinishExpectFailure, &request_state,
393  grpc_schedule_on_exec_ctx),
394  &request_state.response,
397  // Start the HTTP request. We will ~immediately begin a TCP connect
398  // attempt because there's no name to resolve.
399  http_request->Start();
400  exec_ctx.Flush();
401  // Spawn a separate thread which ~immediately cancels the HTTP request.
402  // Note that even though the server is rejecting TCP connections, it can
403  // still take some time for the client to receive that rejection. So
404  // cancelling the request now can trigger the code paths that would get
405  // taken if the TCP connection was truly hanging e.g. from packet loss.
406  // The goal is just to make sure there are no crashes, races, etc.
407  std::thread cancel_thread([&http_request]() {
409  http_request.reset();
410  });
411  // Poll with a deadline explicitly lower than the request timeout, so
412  // that we know that the request timeout isn't just kicking in.
413  PollUntil([&request_state]() { return request_state.done; },
414  AbslDeadlineSeconds(60));
415  cancel_thread.join();
416  }));
417  }
418  for (auto& t : threads) {
419  t.join();
420  }
421 }
422 
423 // The pollent parameter passed to HttpRequest::Get or Post is owned by
424 // the caller and must not be referenced by the HttpRequest after the
425 // requests's on_done callback is invoked. This test verifies that this
426 // isn't happening by destroying the request's pollset set within the
427 // on_done callback.
428 TEST_F(HttpRequestTest, CallerPollentsAreNotReferencedAfterCallbackIsRan) {
429  // Grab an unoccupied port but don't listen on it. The goal
430  // here is just to have a server address that will reject
431  // TCP connection setups.
432  // Note that we could have used a different server for this test case, e.g.
433  // one which accepts TCP connections. All we need here is something for the
434  // client to connect to, since it will be cancelled roughly during the
435  // connection attempt anyways.
436  int fake_server_port = grpc_pick_unused_port_or_die();
437  std::string fake_server_address =
438  absl::StrCat("[::1]:", std::to_string(fake_server_port));
439  RequestState request_state(this);
442  memset(&req, 0, sizeof(req));
443  req.path = const_cast<char*>("/get");
444  request_state.pollset_set_to_destroy_eagerly = grpc_pollset_set_create();
446  pops(), request_state.pollset_set_to_destroy_eagerly);
447  grpc_polling_entity wrapped_pollset_set_to_destroy_eagerly =
449  request_state.pollset_set_to_destroy_eagerly);
450  auto uri = grpc_core::URI::Create("http", fake_server_address, "/get",
451  {} /* query params */, "" /* fragment */);
452  GPR_ASSERT(uri.ok());
455  std::move(*uri), nullptr /* channel args */,
456  &wrapped_pollset_set_to_destroy_eagerly, &req, NSecondsTime(15),
457  GRPC_CLOSURE_CREATE(OnFinishExpectFailure, &request_state,
458  grpc_schedule_on_exec_ctx),
459  &request_state.response,
462  // Start the HTTP request. We'll start the TCP connect attempt right away.
463  http_request->Start();
464  exec_ctx.Flush();
465  http_request.reset(); // cancel the request
466  // Since the request was cancelled, the on_done callback should be flushed
467  // out on the ExecCtx flush below. When the on_done callback is ran, it will
468  // eagerly destroy 'request_state.pollset_set_to_destroy_eagerly'. Thus, we
469  // can't poll on that pollset here.
470  exec_ctx.Flush();
471 }
472 
473 void CancelRequest(grpc_core::HttpRequest* req) {
474  gpr_log(
475  GPR_INFO,
476  "test only HttpRequest::OnHandshakeDone intercept orphaning request: %p",
477  req);
478  req->Orphan();
479 }
480 
481 // This exercises the code paths that happen when we cancel an HTTP request
482 // before the security handshake callback runs, but after that callback has
483 // already been scheduled with a success result. This case is interesting
484 // because the current security handshake API transfers ownership of output
485 // arguments to the caller only if the handshake is successful, rendering
486 // this code path as something that only occurs with just the right timing.
487 TEST_F(HttpRequestTest,
488  CancelDuringSecurityHandshakeButHandshakeStillSucceeds) {
489  RequestState request_state(this);
492  std::string host = absl::StrFormat("localhost:%d", g_server_port);
493  gpr_log(GPR_INFO, "requesting from %s", host.c_str());
494  memset(&req, 0, sizeof(req));
495  auto uri = grpc_core::URI::Create("http", host, "/get", {} /* query params */,
496  "" /* fragment */);
497  GPR_ASSERT(uri.ok());
500  std::move(*uri), nullptr /* channel args */, pops(), &req,
501  NSecondsTime(15),
502  GRPC_CLOSURE_CREATE(OnFinishExpectFailure, &request_state,
503  grpc_schedule_on_exec_ctx),
504  &request_state.response,
508  http_request->Start();
509  (void)http_request.release(); // request will be orphaned by CancelRequest
510  exec_ctx.Flush();
511  PollUntil([&request_state]() { return request_state.done; },
512  AbslDeadlineSeconds(60));
514 }
515 
516 } // namespace
517 
518 int main(int argc, char** argv) {
519  ::testing::InitGoogleTest(&argc, argv);
520  grpc::testing::TestEnvironment env(&argc, argv);
521  // launch the test server later, so that --gtest_list_tests works
522  g_argc = argc;
523  g_argv = argv;
524  // run tests
525  return RUN_ALL_TESTS();
526 }
grpc_pollset_worker
struct grpc_pollset_worker grpc_pollset_worker
Definition: pollset.h:39
absl::time_internal::cctz::seconds
std::chrono::duration< std::int_fast64_t > seconds
Definition: abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h:40
GPR_INFO
#define GPR_INFO
Definition: include/grpc/impl/codegen/log.h:56
grpc_pollset_size
size_t grpc_pollset_size(void)
Definition: pollset.cc:56
iomgr.h
gpr_mu_unlock
GPRAPI void gpr_mu_unlock(gpr_mu *mu)
grpc_polling_entity_pollset
grpc_pollset * grpc_polling_entity_pollset(grpc_polling_entity *pollent)
Definition: polling_entity.cc:42
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
port.h
AF_INET6
#define AF_INET6
Definition: ares_setup.h:208
generate.env
env
Definition: generate.py:37
absl::StrCat
std::string StrCat(const AlphaNum &a, const AlphaNum &b)
Definition: abseil-cpp/absl/strings/str_cat.cc:98
grpc_core::ToAbslTime
absl::Time ToAbslTime(gpr_timespec ts)
Definition: src/core/lib/gprpp/time_util.cc:68
memset
return memset(p, 0, total)
absl::StrFormat
ABSL_MUST_USE_RESULT std::string StrFormat(const FormatSpec< Args... > &format, const Args &... args)
Definition: abseil-cpp/absl/strings/str_format.h:338
absl::Time
Definition: third_party/abseil-cpp/absl/time/time.h:642
grpc_core::MutexLockForGprMu
Definition: src/core/lib/gprpp/sync.h:152
test
Definition: spinlock_test.cc:36
ares_addr_port_node
Definition: ares.h:704
grpc_pollset_set
struct grpc_pollset_set grpc_pollset_set
Definition: iomgr_fwd.h:23
string.h
grpc_pollset_set_create
grpc_pollset_set * grpc_pollset_set_create()
Definition: pollset_set.cc:29
grpc_core::Timestamp
Definition: src/core/lib/gprpp/time.h:62
testing::Test::SetUpTestSuite
static void SetUpTestSuite()
Definition: bloaty/third_party/googletest/googletest/include/gtest/gtest.h:417
gpr_free
GPRAPI void gpr_free(void *ptr)
Definition: alloc.cc:51
test_server
Definition: test_server.py:1
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
error
grpc_error_handle error
Definition: retry_filter.cc:499
time_util.h
grpc_core::HttpRequest
Definition: httpcli.h:82
grpc_pollset_work
grpc_error_handle grpc_pollset_work(grpc_pollset *pollset, grpc_pollset_worker **worker, grpc_core::Timestamp deadline)
Definition: pollset.cc:45
GRPC_LOG_IF_ERROR
#define GRPC_LOG_IF_ERROR(what, error)
Definition: error.h:398
grpc_core::HttpRequest::Post
static OrphanablePtr< HttpRequest > Post(URI uri, const grpc_channel_args *args, grpc_polling_entity *pollent, const grpc_http_request *request, Timestamp deadline, grpc_closure *on_done, grpc_http_response *response, RefCountedPtr< grpc_channel_credentials > channel_creds) GRPC_MUST_USE_RESULT
Definition: httpcli.cc:95
xds_manager.p
p
Definition: xds_manager.py:60
GRPC_CLOSURE_CREATE
#define GRPC_CLOSURE_CREATE(cb, cb_arg, scheduler)
Definition: closure.h:160
grpc_security.h
credentials.h
threads
static uv_thread_t * threads
Definition: threadpool.c:38
testing::Test
Definition: bloaty/third_party/googletest/googletest/include/gtest/gtest.h:402
mu_
Mutex mu_
Definition: oob_backend_metric.cc:115
grpc_pollset_init
void grpc_pollset_init(grpc_pollset *pollset, gpr_mu **mu)
Definition: pollset.cc:33
gpr_zalloc
GPRAPI void * gpr_zalloc(size_t size)
Definition: alloc.cc:40
absl::synchronization_internal::Get
static GraphId Get(const IdMap &id, int num)
Definition: abseil-cpp/absl/synchronization/internal/graphcycles_test.cc:44
string_util.h
grpc_http_response
Definition: src/core/lib/http/parser.h:85
httpcli_test_util.h
channel
wrapped_grpc_channel * channel
Definition: src/php/ext/grpc/call.h:33
autogen_x86imm.f
f
Definition: autogen_x86imm.py:9
grpc_core::testing::FakeUdpAndTcpServer::address
const char * address()
Definition: fake_udp_and_tcp_server.h:92
grpc_core::RefCountedPtr< grpc_channel_credentials >
absl::move
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
Definition: abseil-cpp/absl/utility/utility.h:221
GPR_ASSERT
#define GPR_ASSERT(x)
Definition: include/grpc/impl/codegen/log.h:94
gen_stats_data.c_str
def c_str(s, encoding='ascii')
Definition: gen_stats_data.py:38
grpc_core::ExecCtx::Flush
bool Flush()
Definition: exec_ctx.cc:69
req
static uv_connect_t req
Definition: test-connection-fail.c:30
grpc_ares_wrapper.h
gpr_log
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
worker
Definition: worker.py:1
grpc_polling_entity_create_from_pollset
grpc_polling_entity grpc_polling_entity_create_from_pollset(grpc_pollset *pollset)
Definition: polling_entity.cc:34
gpr_sleep_until
GPRAPI void gpr_sleep_until(gpr_timespec until)
httpcli.h
grpc_core::testing::FakeUdpAndTcpServer
Definition: fake_udp_and_tcp_server.h:72
grpc.h
grpc_pollset_set_destroy
void grpc_pollset_set_destroy(grpc_pollset_set *pollset_set)
Definition: pollset_set.cc:33
grpc_insecure_credentials_create
GRPCAPI grpc_channel_credentials * grpc_insecure_credentials_create()
Definition: core/lib/security/credentials/insecure/insecure_credentials.cc:64
done
struct tab * done
Definition: bloaty/third_party/zlib/examples/enough.c:176
arg
Definition: cmdline.cc:40
time.h
gpr_mu_lock
GPRAPI void gpr_mu_lock(gpr_mu *mu)
grpc_http_response_destroy
void grpc_http_response_destroy(grpc_http_response *response)
Definition: src/core/lib/http/parser.cc:434
grpc_polling_entity
Definition: polling_entity.h:38
RUN_ALL_TESTS
int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_
Definition: bloaty/third_party/googletest/googletest/include/gtest/gtest.h:2471
grpc_core::testing::FakeUdpAndTcpServer::AcceptMode
AcceptMode
Definition: fake_udp_and_tcp_server.h:79
grpc_pick_unused_port_or_die
int grpc_pick_unused_port_or_die(void)
grpc_pollset_kick
grpc_error_handle grpc_pollset_kick(grpc_pollset *pollset, grpc_pollset_worker *specific_worker)
Definition: pollset.cc:51
fake_udp_and_tcp_server.h
ares_addr_port_node::family
int family
Definition: ares.h:706
grpc_core::ExecCtx
Definition: exec_ctx.h:97
ARES_SUCCESS
#define ARES_SUCCESS
Definition: ares.h:98
gpr_subprocess
struct gpr_subprocess gpr_subprocess
Definition: test/core/util/subprocess.h:24
subprocess.h
test_config.h
update_failure_list.test
test
Definition: bloaty/third_party/protobuf/conformance/update_failure_list.py:69
absl::Now
ABSL_NAMESPACE_BEGIN Time Now()
Definition: abseil-cpp/absl/time/clock.cc:39
ares_channeldata
Definition: ares_private.h:266
testing::InitGoogleTest
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
Definition: bloaty/third_party/googletest/googletest/src/gtest.cc:6106
grpc_core::HttpRequest::Get
static OrphanablePtr< HttpRequest > Get(URI uri, const grpc_channel_args *args, grpc_polling_entity *pollent, const grpc_http_request *request, Timestamp deadline, grpc_closure *on_done, grpc_http_response *response, RefCountedPtr< grpc_channel_credentials > channel_creds) GRPC_MUST_USE_RESULT
Definition: httpcli.cc:69
ares_set_servers_ports
CARES_EXTERN int ares_set_servers_ports(ares_channel channel, struct ares_addr_port_node *servers)
Definition: ares_options.c:195
testing::Test::TearDownTestSuite
static void TearDownTestSuite()
Definition: bloaty/third_party/googletest/googletest/include/gtest/gtest.h:427
gpr_mu
pthread_mutex_t gpr_mu
Definition: impl/codegen/sync_posix.h:47
exec_ctx
grpc_core::ExecCtx exec_ctx
Definition: end2end_binder_transport_test.cc:75
grpc_error_std_string
std::string grpc_error_std_string(grpc_error_handle error)
Definition: error.cc:944
kNumThreads
const int kNumThreads
Definition: thread_stress_test.cc:46
grpc_pollset_shutdown
void grpc_pollset_shutdown(grpc_pollset *pollset, grpc_closure *closure)
Definition: pollset.cc:37
absl::str_format_internal::LengthMod::t
@ t
grpc_core::URI::Create
static absl::StatusOr< URI > Create(std::string scheme, std::string authority, std::string path, std::vector< QueryParam > query_parameter_pairs, std::string fragment)
Definition: uri_parser.cc:289
alloc.h
grpc_core::OrphanablePtr
std::unique_ptr< T, Deleter > OrphanablePtr
Definition: orphanable.h:64
asyncio_get_stats.response
response
Definition: asyncio_get_stats.py:28
grpc::testing::TestEnvironment
Definition: test/core/util/test_config.h:54
grpc_polling_entity_add_to_pollset_set
void grpc_polling_entity_add_to_pollset_set(grpc_polling_entity *pollent, grpc_pollset_set *pss_dst)
Definition: polling_entity.cc:61
g_server
static grpc_server * g_server
Definition: api_fuzzer.cc:69
arg
struct arg arg
gpr_subprocess_destroy
void gpr_subprocess_destroy(gpr_subprocess *p)
grpc_core::testing::FakeUdpAndTcpServer::CloseSocketUponCloseFromPeer
static ProcessReadResult CloseSocketUponCloseFromPeer(int bytes_received_size, int read_error, int s)
Definition: fake_udp_and_tcp_server.cc:179
GPR_DEBUG
#define GPR_DEBUG
Definition: include/grpc/impl/codegen/log.h:55
main
int main(int argc, char **argv)
Definition: httpcli_test.cc:518
grpc_core::testing::StartHttpRequestTestServer
HttpRequestTestServer StartHttpRequestTestServer(int argc, char **argv, bool use_ssl)
Definition: httpcli_test_util.cc:40
grpc_init
GRPCAPI void grpc_init(void)
Definition: init.cc:146
grpc_error
Definition: error_internal.h:42
grpc_polling_entity_create_from_pollset_set
grpc_polling_entity grpc_polling_entity_create_from_pollset_set(grpc_pollset_set *pollset_set)
Definition: polling_entity.cc:26
function
std::function< bool(GrpcTool *, int, const char **, const CliCredentials &, GrpcToolOutputCallback)> function
Definition: grpc_tool.cc:250
grpc_core::Timestamp::FromTimespecRoundUp
static Timestamp FromTimespecRoundUp(gpr_timespec t)
Definition: src/core/lib/gprpp/time.cc:136
grpc_pollset
Definition: bm_cq_multiple_threads.cc:37
grpc_pollset_destroy
void grpc_pollset_destroy(grpc_pollset *pollset)
Definition: pollset.cc:41
to_string
static bool to_string(zval *from)
Definition: protobuf/php/ext/google/protobuf/convert.c:333
sync.h
grpc_shutdown
GRPCAPI void grpc_shutdown(void)
Definition: init.cc:209
grpc_ares_test_only_inject_config
void(* grpc_ares_test_only_inject_config)(ares_channel channel)
thread
static uv_thread_t thread
Definition: test-async-null-cb.c:29
grpc_core::HttpRequest::TestOnlySetOnHandshakeDoneIntercept
static void TestOnlySetOnHandshakeDoneIntercept(void(*intercept)(HttpRequest *req))
Definition: httpcli.cc:151
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
GRPC_ERROR_IS_NONE
#define GRPC_ERROR_IS_NONE(err)
Definition: error.h:241
grpc_http_request
Definition: src/core/lib/http/parser.h:69
TEST_F
#define TEST_F(test_fixture, test_name)
Definition: bloaty/third_party/googletest/googletest/include/gtest/gtest.h:2367


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