diff options
author | Makarand Dharmapurikar <makarandd@google.com> | 2016-04-25 09:27:49 -0700 |
---|---|---|
committer | Makarand Dharmapurikar <makarandd@google.com> | 2016-05-01 15:08:46 -0700 |
commit | 77044830ff927c7c55a342030e2e2a9d73d0d723 (patch) | |
tree | 15fc6f2fb638f2103a2a74208dfa0754aee098d1 /src/core/ext/transport/cronet | |
parent | df665073044eac553b2844450cb68a6eafbc0d01 (diff) |
fixed clang formating
Diffstat (limited to 'src/core/ext/transport/cronet')
-rw-r--r-- | src/core/ext/transport/cronet/client/secure/cronet_channel_create.c | 12 | ||||
-rw-r--r-- | src/core/ext/transport/cronet/transport/cronet_transport.c | 19 |
2 files changed, 14 insertions, 17 deletions
diff --git a/src/core/ext/transport/cronet/client/secure/cronet_channel_create.c b/src/core/ext/transport/cronet/client/secure/cronet_channel_create.c index 23189809f7..914c567086 100644 --- a/src/core/ext/transport/cronet/client/secure/cronet_channel_create.c +++ b/src/core/ext/transport/cronet/client/secure/cronet_channel_create.c @@ -54,19 +54,19 @@ typedef struct grpc_cronet_transport grpc_cronet_transport; extern grpc_transport_vtable cronet_vtable; GRPCAPI grpc_channel *grpc_custom_secure_channel_create( - void *engine, const char *target, - const grpc_channel_args *args, void *reserved) { + void *engine, const char *target, const grpc_channel_args *args, + void *reserved) { grpc_cronet_transport *ct = gpr_malloc(sizeof(grpc_cronet_transport)); ct->base.vtable = &cronet_vtable; ct->engine = engine; ct->host = gpr_malloc(strlen(target) + 1); strcpy(ct->host, target); - gpr_log( - GPR_DEBUG, "grpc_create_cronet_transport: cronet_engine = %p, target=%s", - engine, ct->host); + gpr_log(GPR_DEBUG, + "grpc_create_cronet_transport: cronet_engine = %p, target=%s", engine, + ct->host); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; return grpc_channel_create(&exec_ctx, target, args, - GRPC_CLIENT_DIRECT_CHANNEL, (grpc_transport *)ct); + GRPC_CLIENT_DIRECT_CHANNEL, (grpc_transport *)ct); } #endif // COMPILE_WITH_CRONET diff --git a/src/core/ext/transport/cronet/transport/cronet_transport.c b/src/core/ext/transport/cronet/transport/cronet_transport.c index 671bee638e..5c27a4ea00 100644 --- a/src/core/ext/transport/cronet/transport/cronet_transport.c +++ b/src/core/ext/transport/cronet/transport/cronet_transport.c @@ -41,10 +41,10 @@ #include <grpc/support/string_util.h> #include <grpc/support/useful.h> +#include "src/core/ext/transport/chttp2/transport/incoming_metadata.h" #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/support/string.h" #include "src/core/lib/surface/channel.h" -#include "src/core/ext/transport/chttp2/transport/incoming_metadata.h" #include "src/core/lib/transport/metadata_batch.h" #include "src/core/lib/transport/transport_impl.h" #include "third_party/objective_c/Cronet/cronet_c_for_grpc.h" @@ -215,8 +215,7 @@ void on_response_trailers_received( s->response_trailers_received = true; next_recv_step(s, ON_RESPONSE_TRAILERS_RECEIVED); } -void on_write_completed(cronet_bidirectional_stream *stream, - const char *data) { +void on_write_completed(cronet_bidirectional_stream *stream, const char *data) { GRPC_CRONET_TRACE(GPR_DEBUG, "W: on_write_completed"); stream_obj *s = (stream_obj *)stream->annotation; enqueue_callbacks(s->callback_list[CB_SEND_MESSAGE]); @@ -288,7 +287,6 @@ cronet_bidirectional_stream_callback callbacks = {on_request_headers_sent, on_failed, on_canceled}; - void invoke_closing_callback(stream_obj *s) { grpc_chttp2_incoming_metadata_buffer_publish(&s->imb, s->recv_trailing_metadata); @@ -363,7 +361,6 @@ void next_recv_step(stream_obj *s, enum e_caller caller) { gpr_mu_unlock(&s->recv_mu); } - // This function takes the data from s->write_slicebuffer and assembles into // a contiguous byte stream with 5 byte gRPC header prepended. void create_grpc_frame(stream_obj *s) { @@ -390,22 +387,22 @@ void do_write(stream_obj *s) { create_grpc_frame(s); GRPC_CRONET_TRACE(GPR_DEBUG, "W: cronet_bidirectional_stream_write"); cronet_bidirectional_stream_write(s->cbs, s->write_buffer, - (int)s->write_buffer_size, - false); + (int)s->write_buffer_size, false); } } -// +// void next_send_step(stream_obj *s) { - switch(cronet_send_state) { + switch (cronet_send_state) { case CRONET_SEND_IDLE: - GPR_ASSERT(s->cbs); // cronet_bidirectional_stream is not initialized yet. + GPR_ASSERT( + s->cbs); // cronet_bidirectional_stream is not initialized yet. cronet_send_state = CRONET_REQ_STARTED; GRPC_CRONET_TRACE(GPR_DEBUG, "cronet_bidirectional_stream_start to %s", s->url); cronet_bidirectional_stream_start(s->cbs, s->url, 0, "POST", &s->header_array, false); - break; + break; case CRONET_SEND_HEADER: do_write(s); cronet_send_state = CRONET_WRITE; |