fixed clang formating

pull/6214/head
Makarand Dharmapurikar 9 years ago
parent df66507304
commit 77044830ff
  1. 5
      include/grpc/grpc_security.h
  2. 12
      src/core/ext/transport/cronet/client/secure/cronet_channel_create.c
  3. 19
      src/core/ext/transport/cronet/transport/cronet_transport.c

@ -300,9 +300,8 @@ GRPCAPI grpc_channel *grpc_secure_channel_create(
const grpc_channel_args *args, void *reserved);
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_server_credentials object. ---

@ -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

@ -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;

Loading…
Cancel
Save