clang format
This commit is contained in:
parent
a69599141c
commit
5bec133ba0
|
|
@ -52,7 +52,7 @@ template <class InputMessage, class OutputMessage>
|
|||
Status BlockingUnaryCall(ChannelInterface* channel, const RpcMethod& method,
|
||||
ClientContext* context, const InputMessage& request,
|
||||
OutputMessage* result) {
|
||||
CompletionQueue cq(true); // Pluckable completion queue
|
||||
CompletionQueue cq(true); // Pluckable completion queue
|
||||
Call call(channel->CreateCall(method, context, &cq));
|
||||
CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
|
||||
CallOpRecvInitialMetadata, CallOpRecvMessage<OutputMessage>,
|
||||
|
|
|
|||
|
|
@ -147,9 +147,8 @@ class CompletionQueue : private GrpcLibraryCodegen {
|
|||
///
|
||||
/// \return true if read a regular event, false if the queue is shutting down.
|
||||
bool Next(void** tag, bool* ok) {
|
||||
return (AsyncNextInternal(tag, ok,
|
||||
g_core_codegen_interface->gpr_inf_future(
|
||||
GPR_CLOCK_REALTIME)) != SHUTDOWN);
|
||||
return (AsyncNextInternal(tag, ok, g_core_codegen_interface->gpr_inf_future(
|
||||
GPR_CLOCK_REALTIME)) != SHUTDOWN);
|
||||
}
|
||||
|
||||
/// Request the shutdown of the queue.
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ class ClientReader final : public ClientReaderInterface<R> {
|
|||
ClientReader(ChannelInterface* channel, const RpcMethod& method,
|
||||
ClientContext* context, const W& request)
|
||||
: context_(context),
|
||||
cq_(true), // Pluckable cq
|
||||
cq_(true), // Pluckable cq
|
||||
call_(channel->CreateCall(method, context, &cq_)) {
|
||||
CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
|
||||
CallOpClientSendClose>
|
||||
|
|
@ -212,7 +212,7 @@ class ClientWriter : public ClientWriterInterface<W> {
|
|||
ClientWriter(ChannelInterface* channel, const RpcMethod& method,
|
||||
ClientContext* context, R* response)
|
||||
: context_(context),
|
||||
cq_(true), // Pluckable cq
|
||||
cq_(true), // Pluckable cq
|
||||
call_(channel->CreateCall(method, context, &cq_)) {
|
||||
finish_ops_.RecvMessage(response);
|
||||
finish_ops_.AllowNoMessage();
|
||||
|
|
@ -297,7 +297,7 @@ class ClientReaderWriter final : public ClientReaderWriterInterface<W, R> {
|
|||
ClientReaderWriter(ChannelInterface* channel, const RpcMethod& method,
|
||||
ClientContext* context)
|
||||
: context_(context),
|
||||
cq_(true), // Pluckable cq
|
||||
cq_(true), // Pluckable cq
|
||||
call_(channel->CreateCall(method, context, &cq_)) {
|
||||
CallOpSet<CallOpSendInitialMetadata> ops;
|
||||
ops.SendInitialMetadata(context->send_initial_metadata_,
|
||||
|
|
|
|||
|
|
@ -383,9 +383,8 @@ grpc_event grpc_completion_queue_next(grpc_completion_queue *cc,
|
|||
"deadline=gpr_timespec { tv_sec: %" PRId64
|
||||
", tv_nsec: %d, clock_type: %d }, "
|
||||
"reserved=%p)",
|
||||
5,
|
||||
(cc, deadline.tv_sec, deadline.tv_nsec, (int)deadline.clock_type,
|
||||
reserved));
|
||||
5, (cc, deadline.tv_sec, deadline.tv_nsec, (int)deadline.clock_type,
|
||||
reserved));
|
||||
GPR_ASSERT(!reserved);
|
||||
|
||||
dump_pending_tags(cc);
|
||||
|
|
@ -559,9 +558,8 @@ grpc_event grpc_completion_queue_pluck(grpc_completion_queue *cc, void *tag,
|
|||
"deadline=gpr_timespec { tv_sec: %" PRId64
|
||||
", tv_nsec: %d, clock_type: %d }, "
|
||||
"reserved=%p)",
|
||||
6,
|
||||
(cc, tag, deadline.tv_sec, deadline.tv_nsec, (int)deadline.clock_type,
|
||||
reserved));
|
||||
6, (cc, tag, deadline.tv_sec, deadline.tv_nsec,
|
||||
(int)deadline.clock_type, reserved));
|
||||
}
|
||||
GPR_ASSERT(!reserved);
|
||||
|
||||
|
|
|
|||
|
|
@ -95,9 +95,8 @@ void bad_ssl_run(grpc_server *server) {
|
|||
shutdown_started = 1;
|
||||
}
|
||||
ev = grpc_completion_queue_next(
|
||||
cq,
|
||||
gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
|
||||
gpr_time_from_micros(1000000, GPR_TIMESPAN)),
|
||||
cq, gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
|
||||
gpr_time_from_micros(1000000, GPR_TIMESPAN)),
|
||||
NULL);
|
||||
switch (ev.type) {
|
||||
case GRPC_OP_COMPLETE:
|
||||
|
|
|
|||
|
|
@ -65,9 +65,9 @@ typedef struct servers_fixture {
|
|||
} servers_fixture;
|
||||
|
||||
typedef struct request_sequences {
|
||||
size_t n; /* number of iterations */
|
||||
int *connections; /* indexed by the interation number, value is the index of
|
||||
the server it connected to or -1 if none */
|
||||
size_t n; /* number of iterations */
|
||||
int *connections; /* indexed by the interation number, value is the index of
|
||||
the server it connected to or -1 if none */
|
||||
int *connectivity_states; /* indexed by the interation number, value is the
|
||||
client connectivity state */
|
||||
} request_sequences;
|
||||
|
|
|
|||
|
|
@ -120,10 +120,9 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) {
|
|||
|
||||
/* All test configurations */
|
||||
static grpc_end2end_test_config configs[] = {
|
||||
{"chttp2/fullstack+census",
|
||||
FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
|
||||
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
|
||||
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
|
||||
{"chttp2/fullstack+census", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
|
||||
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
|
||||
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
|
||||
chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
|
||||
chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -120,10 +120,9 @@ void chttp2_tear_down_fullstack_compression(grpc_end2end_test_fixture *f) {
|
|||
|
||||
/* All test configurations */
|
||||
static grpc_end2end_test_config configs[] = {
|
||||
{"chttp2/fullstack_compression",
|
||||
FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
|
||||
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
|
||||
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
|
||||
{"chttp2/fullstack_compression", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
|
||||
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
|
||||
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
|
||||
chttp2_create_fixture_fullstack_compression,
|
||||
chttp2_init_client_fullstack_compression,
|
||||
chttp2_init_server_fullstack_compression,
|
||||
|
|
|
|||
|
|
@ -103,10 +103,9 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) {
|
|||
|
||||
/* All test configurations */
|
||||
static grpc_end2end_test_config configs[] = {
|
||||
{"chttp2/fullstack",
|
||||
FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
|
||||
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
|
||||
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
|
||||
{"chttp2/fullstack", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
|
||||
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
|
||||
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
|
||||
chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
|
||||
chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -103,10 +103,9 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) {
|
|||
|
||||
/* All test configurations */
|
||||
static grpc_end2end_test_config configs[] = {
|
||||
{"chttp2/fullstack",
|
||||
FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
|
||||
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
|
||||
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
|
||||
{"chttp2/fullstack", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
|
||||
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
|
||||
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
|
||||
chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
|
||||
chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -97,10 +97,9 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) {
|
|||
|
||||
/* All test configurations */
|
||||
static grpc_end2end_test_config configs[] = {
|
||||
{"chttp2/fullstack",
|
||||
FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
|
||||
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
|
||||
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
|
||||
{"chttp2/fullstack", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
|
||||
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
|
||||
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
|
||||
chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
|
||||
chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -108,10 +108,9 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) {
|
|||
|
||||
/* All test configurations */
|
||||
static grpc_end2end_test_config configs[] = {
|
||||
{"chttp2/fullstack",
|
||||
FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
|
||||
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
|
||||
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
|
||||
{"chttp2/fullstack", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
|
||||
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
|
||||
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
|
||||
chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
|
||||
chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -114,11 +114,10 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) {
|
|||
|
||||
/* All test configurations */
|
||||
static grpc_end2end_test_config configs[] = {
|
||||
{"chttp2/fullstack+proxy",
|
||||
FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
|
||||
FEATURE_MASK_SUPPORTS_REQUEST_PROXYING |
|
||||
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
|
||||
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
|
||||
{"chttp2/fullstack+proxy", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
|
||||
FEATURE_MASK_SUPPORTS_REQUEST_PROXYING |
|
||||
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
|
||||
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
|
||||
chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
|
||||
chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -204,17 +204,15 @@ CLIENT_INIT(BAD_CERT_PAIR)
|
|||
|
||||
typedef enum { SUCCESS, FAIL } test_result;
|
||||
|
||||
#define SSL_TEST(request_type, cert_type, result) \
|
||||
{ \
|
||||
{TEST_NAME(request_type, cert_type, result), \
|
||||
FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | \
|
||||
FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS | \
|
||||
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL, \
|
||||
chttp2_create_fixture_secure_fullstack, \
|
||||
CLIENT_INIT_NAME(cert_type), \
|
||||
SERVER_INIT_NAME(request_type), \
|
||||
chttp2_tear_down_secure_fullstack}, \
|
||||
result \
|
||||
#define SSL_TEST(request_type, cert_type, result) \
|
||||
{ \
|
||||
{TEST_NAME(request_type, cert_type, result), \
|
||||
FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | \
|
||||
FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS | \
|
||||
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL, \
|
||||
chttp2_create_fixture_secure_fullstack, CLIENT_INIT_NAME(cert_type), \
|
||||
SERVER_INIT_NAME(request_type), chttp2_tear_down_secure_fullstack}, \
|
||||
result \
|
||||
}
|
||||
|
||||
/* All test configurations */
|
||||
|
|
|
|||
|
|
@ -102,10 +102,9 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) {
|
|||
|
||||
/* All test configurations */
|
||||
static grpc_end2end_test_config configs[] = {
|
||||
{"chttp2/fullstack_uds",
|
||||
FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
|
||||
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
|
||||
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
|
||||
{"chttp2/fullstack_uds", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
|
||||
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
|
||||
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
|
||||
chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
|
||||
chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -314,9 +314,8 @@ static grpc_call_credentials *read_call_creds(input_stream *inp) {
|
|||
cred_artifact_ctx ctx = CRED_ARTIFACT_CTX_INIT;
|
||||
const char *access_token = read_cred_artifact(&ctx, inp, NULL, 0);
|
||||
grpc_call_credentials *out =
|
||||
access_token == NULL
|
||||
? NULL
|
||||
: grpc_access_token_credentials_create(access_token, NULL);
|
||||
access_token == NULL ? NULL : grpc_access_token_credentials_create(
|
||||
access_token, NULL);
|
||||
cred_artifact_ctx_finish(&ctx);
|
||||
return out;
|
||||
}
|
||||
|
|
@ -410,9 +409,8 @@ void my_resolve_address(grpc_exec_ctx *exec_ctx, const char *addr,
|
|||
r->on_done = on_done;
|
||||
r->addrs = addresses;
|
||||
grpc_timer_init(
|
||||
exec_ctx, &r->timer,
|
||||
gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC),
|
||||
gpr_time_from_seconds(1, GPR_TIMESPAN)),
|
||||
exec_ctx, &r->timer, gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC),
|
||||
gpr_time_from_seconds(1, GPR_TIMESPAN)),
|
||||
grpc_closure_create(finish_resolve, r, grpc_schedule_on_exec_ctx),
|
||||
gpr_now(GPR_CLOCK_MONOTONIC));
|
||||
}
|
||||
|
|
@ -473,9 +471,8 @@ static void sched_connect(grpc_exec_ctx *exec_ctx, grpc_closure *closure,
|
|||
fc->ep = ep;
|
||||
fc->deadline = deadline;
|
||||
grpc_timer_init(
|
||||
exec_ctx, &fc->timer,
|
||||
gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC),
|
||||
gpr_time_from_millis(1, GPR_TIMESPAN)),
|
||||
exec_ctx, &fc->timer, gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC),
|
||||
gpr_time_from_millis(1, GPR_TIMESPAN)),
|
||||
grpc_closure_create(do_connect, fc, grpc_schedule_on_exec_ctx),
|
||||
gpr_now(GPR_CLOCK_MONOTONIC));
|
||||
}
|
||||
|
|
@ -751,9 +748,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
|||
if (g_server != NULL) {
|
||||
if (!server_shutdown) {
|
||||
grpc_server_shutdown_and_notify(
|
||||
g_server, cq,
|
||||
create_validator(assert_success_and_decrement,
|
||||
&pending_server_shutdowns));
|
||||
g_server, cq, create_validator(assert_success_and_decrement,
|
||||
&pending_server_shutdowns));
|
||||
server_shutdown = true;
|
||||
pending_server_shutdowns++;
|
||||
} else if (pending_server_shutdowns == 0) {
|
||||
|
|
@ -858,9 +854,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
|||
case 5: {
|
||||
if (g_server != NULL) {
|
||||
grpc_server_shutdown_and_notify(
|
||||
g_server, cq,
|
||||
create_validator(assert_success_and_decrement,
|
||||
&pending_server_shutdowns));
|
||||
g_server, cq, create_validator(assert_success_and_decrement,
|
||||
&pending_server_shutdowns));
|
||||
pending_server_shutdowns++;
|
||||
server_shutdown = true;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -257,9 +257,8 @@ int main(int argc, char **argv) {
|
|||
shutdown_started = 1;
|
||||
}
|
||||
ev = grpc_completion_queue_next(
|
||||
cq,
|
||||
gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
|
||||
gpr_time_from_micros(1000000, GPR_TIMESPAN)),
|
||||
cq, gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
|
||||
gpr_time_from_micros(1000000, GPR_TIMESPAN)),
|
||||
NULL);
|
||||
s = ev.tag;
|
||||
switch (ev.type) {
|
||||
|
|
|
|||
|
|
@ -261,9 +261,8 @@ int main(int argc, char **argv) {
|
|||
|
||||
do {
|
||||
event = grpc_completion_queue_next(
|
||||
cq,
|
||||
gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
|
||||
gpr_time_from_micros(10000, GPR_TIMESPAN)),
|
||||
cq, gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
|
||||
gpr_time_from_micros(10000, GPR_TIMESPAN)),
|
||||
NULL);
|
||||
} while (event.type != GRPC_QUEUE_TIMEOUT);
|
||||
|
||||
|
|
|
|||
|
|
@ -243,9 +243,8 @@ int main(int argc, char **argv) {
|
|||
shutdown_started = 1;
|
||||
}
|
||||
ev = grpc_completion_queue_next(
|
||||
cq,
|
||||
gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
|
||||
gpr_time_from_micros(1000000, GPR_TIMESPAN)),
|
||||
cq, gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
|
||||
gpr_time_from_micros(1000000, GPR_TIMESPAN)),
|
||||
NULL);
|
||||
fling_call *s = ev.tag;
|
||||
switch (ev.type) {
|
||||
|
|
|
|||
|
|
@ -354,9 +354,8 @@ static void start_backend_server(server_fixture *sf) {
|
|||
}
|
||||
GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
|
||||
const string expected_token =
|
||||
strlen(sf->lb_token_prefix) == 0
|
||||
? ""
|
||||
: sf->lb_token_prefix + std::to_string(sf->port);
|
||||
strlen(sf->lb_token_prefix) == 0 ? "" : sf->lb_token_prefix +
|
||||
std::to_string(sf->port);
|
||||
GPR_ASSERT(contains_metadata(&request_metadata_recv, "lb-token",
|
||||
expected_token.c_str()));
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue