Merge pull request #5895 from ctiller/clang_fmt_upd

Update clang-format to 3.8
pull/5813/merge
Nicolas Noble 9 years ago
commit f6a87f8912
  1. 2
      include/grpc++/generic/async_generic_service.h
  2. 6
      include/grpc++/impl/codegen/async_stream.h
  3. 9
      include/grpc++/impl/codegen/async_unary_call.h
  4. 3
      include/grpc++/impl/codegen/call.h
  5. 3
      include/grpc++/impl/codegen/client_unary_call.h
  6. 6
      include/grpc++/impl/codegen/impl/async_stream.h
  7. 18
      include/grpc++/impl/codegen/method_handler_impl.h
  8. 2
      include/grpc++/impl/codegen/rpc_service_method.h
  9. 6
      include/grpc++/impl/codegen/server_context.h
  10. 7
      include/grpc++/impl/codegen/server_interface.h
  11. 6
      include/grpc++/impl/codegen/sync_stream.h
  12. 6
      include/grpc++/support/byte_buffer.h
  13. 4
      include/grpc++/support/channel_arguments.h
  14. 2
      include/grpc++/support/slice.h
  15. 4
      include/grpc/byte_buffer_reader.h
  16. 7
      include/grpc/compression.h
  17. 32
      include/grpc/grpc.h
  18. 9
      include/grpc/grpc_security.h
  19. 2
      include/grpc/impl/codegen/log.h
  20. 4
      include/grpc/impl/codegen/slice.h
  21. 4
      include/grpc/impl/codegen/slice_buffer.h
  22. 4
      include/grpc/impl/codegen/time.h
  23. 30
      src/core/census/grpc_filter.c
  24. 2
      src/core/census/grpc_plugin.c
  25. 2
      src/core/channel/channel_args.c
  26. 14
      src/core/channel/client_channel.c
  27. 15
      src/core/channel/compress_filter.c
  28. 20
      src/core/channel/connected_channel.c
  29. 15
      src/core/channel/http_client_filter.c
  30. 15
      src/core/channel/http_server_filter.c
  31. 10
      src/core/client_config/lb_policies/pick_first.c
  32. 10
      src/core/client_config/lb_policies/round_robin.c
  33. 2
      src/core/client_config/resolvers/zookeeper_resolver.c
  34. 16
      src/core/client_config/subchannel.c
  35. 16
      src/core/client_config/subchannel.h
  36. 2
      src/core/http/format_request.c
  37. 2
      src/core/http/format_request.h
  38. 4
      src/core/http/httpcli_security_connector.c
  39. 4
      src/core/iomgr/endpoint.h
  40. 6
      src/core/iomgr/endpoint_pair_posix.c
  41. 8
      src/core/iomgr/endpoint_pair_windows.c
  42. 4
      src/core/iomgr/fd_posix.h
  43. 4
      src/core/iomgr/iocp_windows.c
  44. 2
      src/core/iomgr/iomgr_internal.h
  45. 4
      src/core/iomgr/iomgr_posix.c
  46. 4
      src/core/iomgr/iomgr_windows.c
  47. 2
      src/core/iomgr/pollset_windows.c
  48. 4
      src/core/iomgr/sockaddr_posix.h
  49. 2
      src/core/iomgr/sockaddr_win32.h
  50. 14
      src/core/iomgr/socket_utils_common_posix.c
  51. 4
      src/core/iomgr/socket_utils_linux.c
  52. 2
      src/core/iomgr/socket_utils_posix.h
  53. 4
      src/core/iomgr/socket_windows.c
  54. 4
      src/core/iomgr/socket_windows.h
  55. 2
      src/core/iomgr/tcp_client.h
  56. 6
      src/core/iomgr/tcp_client_windows.c
  57. 4
      src/core/iomgr/tcp_posix.c
  58. 10
      src/core/iomgr/tcp_server_posix.c
  59. 8
      src/core/iomgr/tcp_windows.c
  60. 4
      src/core/iomgr/timer.h
  61. 12
      src/core/iomgr/udp_server.c
  62. 2
      src/core/iomgr/unix_sockets_posix.c
  63. 4
      src/core/iomgr/wakeup_fd_nospecial.c
  64. 6
      src/core/iomgr/wakeup_fd_posix.c
  65. 4
      src/core/iomgr/workqueue.h
  66. 4
      src/core/json/json_string.c
  67. 4
      src/core/profiling/basic_timers.c
  68. 6
      src/core/security/client_auth_filter.c
  69. 2
      src/core/security/credentials.c
  70. 2
      src/core/security/credentials.h
  71. 4
      src/core/security/handshake.c
  72. 11
      src/core/security/secure_endpoint.c
  73. 2
      src/core/security/secure_endpoint.h
  74. 2
      src/core/security/security_context.c
  75. 6
      src/core/security/server_auth_filter.c
  76. 8
      src/core/security/server_secure_chttp2.c
  77. 4
      src/core/statistics/census_log.c
  78. 14
      src/core/statistics/census_rpc_stats.c
  79. 2
      src/core/statistics/census_rpc_stats.h
  80. 15
      src/core/statistics/census_tracing.c
  81. 6
      src/core/statistics/hash_table.c
  82. 8
      src/core/statistics/window_stats.c
  83. 2
      src/core/support/alloc.c
  84. 4
      src/core/support/cmdline.c
  85. 6
      src/core/support/cpu_linux.c
  86. 2
      src/core/support/cpu_posix.c
  87. 4
      src/core/support/env_posix.c
  88. 4
      src/core/support/histogram.c
  89. 4
      src/core/support/host_port.c
  90. 6
      src/core/support/log_android.c
  91. 8
      src/core/support/log_linux.c
  92. 8
      src/core/support/log_posix.c
  93. 6
      src/core/support/log_win32.c
  94. 10
      src/core/support/stack_lockfree.c
  95. 2
      src/core/support/string.h
  96. 4
      src/core/support/string_posix.c
  97. 2
      src/core/support/string_win32.c
  98. 8
      src/core/support/subprocess_posix.c
  99. 2
      src/core/support/subprocess_windows.c
  100. 2
      src/core/support/sync.c
  101. Some files were not shown because too many files have changed in this diff Show More

@ -34,8 +34,8 @@
#ifndef GRPCXX_GENERIC_ASYNC_GENERIC_SERVICE_H
#define GRPCXX_GENERIC_ASYNC_GENERIC_SERVICE_H
#include <grpc++/support/byte_buffer.h>
#include <grpc++/support/async_stream.h>
#include <grpc++/support/byte_buffer.h>
struct grpc_server;

@ -215,7 +215,8 @@ class ClientAsyncWriter GRPC_FINAL : public ClientAsyncWriterInterface<W> {
CallOpSet<CallOpSendMessage> write_ops_;
CallOpSet<CallOpClientSendClose> writes_done_ops_;
CallOpSet<CallOpRecvInitialMetadata, CallOpGenericRecvMessage,
CallOpClientRecvStatus> finish_ops_;
CallOpClientRecvStatus>
finish_ops_;
};
/// Client-side interface for asynchronous bi-directional streaming.
@ -350,7 +351,8 @@ class ServerAsyncReader GRPC_FINAL : public ServerAsyncStreamingInterface,
CallOpSet<CallOpSendInitialMetadata> meta_ops_;
CallOpSet<CallOpRecvMessage<R>> read_ops_;
CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
CallOpServerSendStatus> finish_ops_;
CallOpServerSendStatus>
finish_ops_;
};
template <class W>

@ -101,10 +101,12 @@ class ClientAsyncResponseReader GRPC_FINAL
class CallOpSetCollection : public CallOpSetCollectionInterface {
public:
SneakyCallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
CallOpClientSendClose> init_buf_;
CallOpClientSendClose>
init_buf_;
CallOpSet<CallOpRecvInitialMetadata> meta_buf_;
CallOpSet<CallOpRecvInitialMetadata, CallOpRecvMessage<R>,
CallOpClientRecvStatus> finish_buf_;
CallOpClientRecvStatus>
finish_buf_;
};
std::shared_ptr<CallOpSetCollection> collection_;
};
@ -159,7 +161,8 @@ class ServerAsyncResponseWriter GRPC_FINAL
ServerContext* ctx_;
CallOpSet<CallOpSendInitialMetadata> meta_buf_;
CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
CallOpServerSendStatus> finish_buf_;
CallOpServerSendStatus>
finish_buf_;
};
} // namespace grpc

@ -280,7 +280,8 @@ class CallOpRecvMessage {
if (*status) {
got_message = true;
*status = SerializationTraits<R>::Deserialize(recv_buf_, message_,
max_message_size).ok();
max_message_size)
.ok();
} else {
got_message = false;
g_core_codegen_interface->grpc_byte_buffer_destroy(recv_buf_);

@ -56,7 +56,8 @@ Status BlockingUnaryCall(ChannelInterface* channel, const RpcMethod& method,
Call call(channel->CreateCall(method, context, &cq));
CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
CallOpRecvInitialMetadata, CallOpRecvMessage<OutputMessage>,
CallOpClientSendClose, CallOpClientRecvStatus> ops;
CallOpClientSendClose, CallOpClientRecvStatus>
ops;
Status status = ops.SendMessage(request);
if (!status.ok()) {
return status;

@ -215,7 +215,8 @@ class ClientAsyncWriter GRPC_FINAL : public ClientAsyncWriterInterface<W> {
CallOpSet<CallOpSendMessage> write_ops_;
CallOpSet<CallOpClientSendClose> writes_done_ops_;
CallOpSet<CallOpRecvInitialMetadata, CallOpGenericRecvMessage,
CallOpClientRecvStatus> finish_ops_;
CallOpClientRecvStatus>
finish_ops_;
};
/// Client-side interface for asynchronous bi-directional streaming.
@ -350,7 +351,8 @@ class ServerAsyncReader GRPC_FINAL : public ServerAsyncStreamingInterface,
CallOpSet<CallOpSendInitialMetadata> meta_ops_;
CallOpSet<CallOpRecvMessage<R>> read_ops_;
CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
CallOpServerSendStatus> finish_ops_;
CallOpServerSendStatus>
finish_ops_;
};
template <class W>

@ -61,7 +61,8 @@ class RpcMethodHandler : public MethodHandler {
GPR_CODEGEN_ASSERT(!param.server_context->sent_initial_metadata_);
CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
CallOpServerSendStatus> ops;
CallOpServerSendStatus>
ops;
ops.SendInitialMetadata(param.server_context->initial_metadata_);
if (status.ok()) {
status = ops.SendMessage(rsp);
@ -74,7 +75,8 @@ class RpcMethodHandler : public MethodHandler {
private:
// Application provided rpc handler function.
std::function<Status(ServiceType*, ServerContext*, const RequestType*,
ResponseType*)> func_;
ResponseType*)>
func_;
// The class the above handler function lives in.
ServiceType* service_;
};
@ -96,7 +98,8 @@ class ClientStreamingHandler : public MethodHandler {
GPR_CODEGEN_ASSERT(!param.server_context->sent_initial_metadata_);
CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
CallOpServerSendStatus> ops;
CallOpServerSendStatus>
ops;
ops.SendInitialMetadata(param.server_context->initial_metadata_);
if (status.ok()) {
status = ops.SendMessage(rsp);
@ -108,7 +111,8 @@ class ClientStreamingHandler : public MethodHandler {
private:
std::function<Status(ServiceType*, ServerContext*, ServerReader<RequestType>*,
ResponseType*)> func_;
ResponseType*)>
func_;
ServiceType* service_;
};
@ -143,7 +147,8 @@ class ServerStreamingHandler : public MethodHandler {
private:
std::function<Status(ServiceType*, ServerContext*, const RequestType*,
ServerWriter<ResponseType>*)> func_;
ServerWriter<ResponseType>*)>
func_;
ServiceType* service_;
};
@ -174,7 +179,8 @@ class BidiStreamingHandler : public MethodHandler {
private:
std::function<Status(ServiceType*, ServerContext*,
ServerReaderWriter<ResponseType, RequestType>*)> func_;
ServerReaderWriter<ResponseType, RequestType>*)>
func_;
ServiceType* service_;
};

@ -40,10 +40,10 @@
#include <memory>
#include <vector>
#include <grpc/impl/codegen/byte_buffer.h>
#include <grpc++/impl/codegen/config.h>
#include <grpc++/impl/codegen/rpc_method.h>
#include <grpc++/impl/codegen/status.h>
#include <grpc/impl/codegen/byte_buffer.h>
namespace grpc {
class ServerContext;

@ -37,12 +37,12 @@
#include <map>
#include <memory>
#include <grpc/impl/codegen/compression_types.h>
#include <grpc/impl/codegen/time.h>
#include <grpc++/impl/codegen/security/auth_context.h>
#include <grpc++/impl/codegen/config.h>
#include <grpc++/impl/codegen/security/auth_context.h>
#include <grpc++/impl/codegen/string_ref.h>
#include <grpc++/impl/codegen/time.h>
#include <grpc/impl/codegen/compression_types.h>
#include <grpc/impl/codegen/time.h>
struct gpr_timespec;
struct grpc_metadata;

@ -192,10 +192,11 @@ class ServerInterface : public CallHook {
bool FinalizeResult(void** tag, bool* status) GRPC_OVERRIDE {
bool serialization_status =
*status && payload_ &&
SerializationTraits<Message>::Deserialize(
payload_, request_, server_->max_message_size()).ok();
SerializationTraits<Message>::Deserialize(payload_, request_,
server_->max_message_size())
.ok();
bool ret = RegisteredAsyncRequest::FinalizeResult(tag, status);
*status = serialization_status&&* status;
*status = serialization_status && *status;
return ret;
}

@ -123,7 +123,8 @@ class ClientReader GRPC_FINAL : public ClientReaderInterface<R> {
ClientContext* context, const W& request)
: context_(context), call_(channel->CreateCall(method, context, &cq_)) {
CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
CallOpClientSendClose> ops;
CallOpClientSendClose>
ops;
ops.SendInitialMetadata(context->send_initial_metadata_);
// TODO(ctiller): don't assert
GPR_CODEGEN_ASSERT(ops.SendMessage(request).ok());
@ -235,7 +236,8 @@ class ClientWriter : public ClientWriterInterface<W> {
private:
ClientContext* context_;
CallOpSet<CallOpRecvInitialMetadata, CallOpGenericRecvMessage,
CallOpClientRecvStatus> finish_ops_;
CallOpClientRecvStatus>
finish_ops_;
CompletionQueue cq_;
Call call_;
};

@ -34,13 +34,13 @@
#ifndef GRPCXX_SUPPORT_BYTE_BUFFER_H
#define GRPCXX_SUPPORT_BYTE_BUFFER_H
#include <grpc/grpc.h>
#include <grpc/byte_buffer.h>
#include <grpc/support/log.h>
#include <grpc++/impl/serialization_traits.h>
#include <grpc++/support/config.h>
#include <grpc++/support/slice.h>
#include <grpc++/support/status.h>
#include <grpc/byte_buffer.h>
#include <grpc/grpc.h>
#include <grpc/support/log.h>
#include <vector>

@ -34,12 +34,12 @@
#ifndef GRPCXX_SUPPORT_CHANNEL_ARGUMENTS_H
#define GRPCXX_SUPPORT_CHANNEL_ARGUMENTS_H
#include <vector>
#include <list>
#include <vector>
#include <grpc++/support/config.h>
#include <grpc/compression.h>
#include <grpc/grpc.h>
#include <grpc++/support/config.h>
namespace grpc {
namespace testing {

@ -34,8 +34,8 @@
#ifndef GRPCXX_SUPPORT_SLICE_H
#define GRPCXX_SUPPORT_SLICE_H
#include <grpc/support/slice.h>
#include <grpc++/support/config.h>
#include <grpc/support/slice.h>
namespace grpc {

@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -34,8 +34,8 @@
#ifndef GRPC_BYTE_BUFFER_READER_H
#define GRPC_BYTE_BUFFER_READER_H
#include <grpc/grpc.h>
#include <grpc/byte_buffer.h>
#include <grpc/grpc.h>
#ifdef __cplusplus
extern "C" {

@ -36,8 +36,8 @@
#include <stdlib.h>
#include <grpc/impl/codegen/port_platform.h>
#include <grpc/impl/codegen/compression_types.h>
#include <grpc/impl/codegen/port_platform.h>
#ifdef __cplusplus
extern "C" {
@ -59,9 +59,8 @@ GRPCAPI int grpc_compression_algorithm_name(
* compression algorithms encoded in the \a accepted_encodings bitset.
*
* It abort()s for unknown levels . */
GRPCAPI grpc_compression_algorithm
grpc_compression_algorithm_for_level(grpc_compression_level level,
uint32_t accepted_encodings);
GRPCAPI grpc_compression_algorithm grpc_compression_algorithm_for_level(
grpc_compression_level level, uint32_t accepted_encodings);
GRPCAPI void grpc_compression_options_init(grpc_compression_options *opts);

@ -36,13 +36,13 @@
#include <grpc/status.h>
#include <stddef.h>
#include <grpc/byte_buffer.h>
#include <grpc/support/slice.h>
#include <grpc/support/time.h>
#include <grpc/impl/codegen/connectivity_state.h>
#include <grpc/impl/codegen/propagation_bits.h>
#include <grpc/impl/codegen/grpc_types.h>
#include <grpc/impl/codegen/propagation_bits.h>
#include <grpc/support/slice.h>
#include <grpc/support/time.h>
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
@ -154,9 +154,8 @@ GRPCAPI void grpc_alarm_cancel(grpc_alarm *alarm);
GRPCAPI void grpc_alarm_destroy(grpc_alarm *alarm);
/** Check the connectivity state of a channel. */
GRPCAPI grpc_connectivity_state
grpc_channel_check_connectivity_state(grpc_channel *channel,
int try_to_connect);
GRPCAPI grpc_connectivity_state grpc_channel_check_connectivity_state(
grpc_channel *channel, int try_to_connect);
/** Watch for a change in connectivity state.
Once the channel connectivity state is different from last_observed_state,
@ -267,9 +266,10 @@ GRPCAPI grpc_call_error grpc_call_cancel(grpc_call *call, void *reserved);
and description passed in.
Importantly, this function does not send status nor description to the
remote endpoint. */
GRPCAPI grpc_call_error
grpc_call_cancel_with_status(grpc_call *call, grpc_status_code status,
const char *description, void *reserved);
GRPCAPI grpc_call_error grpc_call_cancel_with_status(grpc_call *call,
grpc_status_code status,
const char *description,
void *reserved);
/** Destroy a call.
THREAD SAFETY: grpc_call_destroy is thread-compatible */
@ -283,13 +283,11 @@ GRPCAPI void grpc_call_destroy(grpc_call *call);
to \a cq_bound_to_call.
Note that \a cq_for_notification must have been registered to the server via
\a grpc_server_register_completion_queue. */
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);
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);
/** Registers a method in the server.
Methods to this (host, method) pair will not be reported by

@ -80,9 +80,8 @@ grpc_auth_context_peer_identity(const grpc_auth_context *ctx);
/* Finds a property in the context. May return an empty iterator (first _next
will return NULL) if no property with this name was found in the context. */
GRPCAPI grpc_auth_property_iterator
grpc_auth_context_find_properties_by_name(const grpc_auth_context *ctx,
const char *name);
GRPCAPI grpc_auth_property_iterator grpc_auth_context_find_properties_by_name(
const grpc_auth_context *ctx, const char *name);
/* Gets the name of the property that indicates the peer identity. Will return
NULL if the peer is not authenticated. */
@ -363,8 +362,8 @@ GRPCAPI int grpc_server_add_secure_http2_port(grpc_server *server,
/* Sets a credentials to a call. Can only be called on the client side before
grpc_call_start_batch. */
GRPCAPI grpc_call_error
grpc_call_set_credentials(grpc_call *call, grpc_call_credentials *creds);
GRPCAPI grpc_call_error grpc_call_set_credentials(grpc_call *call,
grpc_call_credentials *creds);
/* --- Auth Metadata Processing --- */

@ -34,8 +34,8 @@
#ifndef GRPC_IMPL_CODEGEN_LOG_H
#define GRPC_IMPL_CODEGEN_LOG_H
#include <stdlib.h> /* for abort() */
#include <stdarg.h>
#include <stdlib.h> /* for abort() */
#include <grpc/impl/codegen/port_platform.h>

@ -122,8 +122,8 @@ GPRAPI gpr_slice gpr_slice_new(void *p, size_t len, void (*destroy)(void *));
/* Equivalent to gpr_slice_new, but with a two argument destroy function that
also takes the slice length. */
GPRAPI gpr_slice
gpr_slice_new_with_len(void *p, size_t len, void (*destroy)(void *, size_t));
GPRAPI gpr_slice gpr_slice_new_with_len(void *p, size_t len,
void (*destroy)(void *, size_t));
/* Equivalent to gpr_slice_new(malloc(len), len, free), but saves one malloc()
call.

@ -73,8 +73,8 @@ GPRAPI void gpr_slice_buffer_add(gpr_slice_buffer *sb, gpr_slice slice);
slice at the returned index in sb->slices)
The implementation MAY decide to concatenate data at the end of a small
slice added in this fashion. */
GPRAPI size_t
gpr_slice_buffer_add_indexed(gpr_slice_buffer *sb, gpr_slice slice);
GPRAPI size_t gpr_slice_buffer_add_indexed(gpr_slice_buffer *sb,
gpr_slice slice);
GPRAPI void gpr_slice_buffer_addn(gpr_slice_buffer *sb, gpr_slice *slices,
size_t n);
/* add a very small (less than 8 bytes) amount of data to the end of a slice

@ -88,8 +88,8 @@ GPRAPI void gpr_time_init(void);
GPRAPI gpr_timespec gpr_now(gpr_clock_type clock);
/* Convert a timespec from one clock to another */
GPRAPI gpr_timespec
gpr_convert_clock_type(gpr_timespec t, gpr_clock_type target_clock);
GPRAPI gpr_timespec gpr_convert_clock_type(gpr_timespec t,
gpr_clock_type target_clock);
/* Return -ve, 0, or +ve according to whether a < b, a == b, or a > b
respectively. */

@ -172,13 +172,27 @@ static void destroy_channel_elem(grpc_exec_ctx *exec_ctx,
}
const grpc_channel_filter grpc_client_census_filter = {
client_start_transport_op, grpc_channel_next_op, sizeof(call_data),
client_init_call_elem, grpc_call_stack_ignore_set_pollset,
client_destroy_call_elem, sizeof(channel_data), init_channel_elem,
destroy_channel_elem, grpc_call_next_get_peer, "census-client"};
client_start_transport_op,
grpc_channel_next_op,
sizeof(call_data),
client_init_call_elem,
grpc_call_stack_ignore_set_pollset,
client_destroy_call_elem,
sizeof(channel_data),
init_channel_elem,
destroy_channel_elem,
grpc_call_next_get_peer,
"census-client"};
const grpc_channel_filter grpc_server_census_filter = {
server_start_transport_op, grpc_channel_next_op, sizeof(call_data),
server_init_call_elem, grpc_call_stack_ignore_set_pollset,
server_destroy_call_elem, sizeof(channel_data), init_channel_elem,
destroy_channel_elem, grpc_call_next_get_peer, "census-server"};
server_start_transport_op,
grpc_channel_next_op,
sizeof(call_data),
server_init_call_elem,
grpc_call_stack_ignore_set_pollset,
server_destroy_call_elem,
sizeof(channel_data),
init_channel_elem,
destroy_channel_elem,
grpc_call_next_get_peer,
"census-server"};

@ -38,8 +38,8 @@
#include <grpc/census.h>
#include "src/core/census/grpc_filter.h"
#include "src/core/surface/channel_init.h"
#include "src/core/channel/channel_stack_builder.h"
#include "src/core/surface/channel_init.h"
static bool maybe_add_census_filter(grpc_channel_stack_builder *builder,
void *arg_must_be_null) {

@ -31,8 +31,8 @@
*
*/
#include <grpc/grpc.h>
#include "src/core/channel/channel_args.h"
#include <grpc/grpc.h>
#include "src/core/support/string.h"
#include <grpc/census.h>

@ -431,9 +431,17 @@ static void cc_set_pollset(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
}
const grpc_channel_filter grpc_client_channel_filter = {
cc_start_transport_stream_op, cc_start_transport_op, sizeof(call_data),
init_call_elem, cc_set_pollset, destroy_call_elem, sizeof(channel_data),
init_channel_elem, destroy_channel_elem, cc_get_peer, "client-channel",
cc_start_transport_stream_op,
cc_start_transport_op,
sizeof(call_data),
init_call_elem,
cc_set_pollset,
destroy_call_elem,
sizeof(channel_data),
init_channel_elem,
destroy_channel_elem,
cc_get_peer,
"client-channel",
};
void grpc_client_channel_set_resolver(grpc_exec_ctx *exec_ctx,

@ -291,7 +291,14 @@ static void destroy_channel_elem(grpc_exec_ctx *exec_ctx,
grpc_channel_element *elem) {}
const grpc_channel_filter grpc_compress_filter = {
compress_start_transport_stream_op, grpc_channel_next_op, sizeof(call_data),
init_call_elem, grpc_call_stack_ignore_set_pollset, destroy_call_elem,
sizeof(channel_data), init_channel_elem, destroy_channel_elem,
grpc_call_next_get_peer, "compress"};
compress_start_transport_stream_op,
grpc_channel_next_op,
sizeof(call_data),
init_call_elem,
grpc_call_stack_ignore_set_pollset,
destroy_call_elem,
sizeof(channel_data),
init_channel_elem,
destroy_channel_elem,
grpc_call_next_get_peer,
"compress"};

@ -37,13 +37,13 @@
#include <stdio.h>
#include <string.h>
#include "src/core/support/string.h"
#include "src/core/transport/transport.h"
#include "src/core/profiling/timers.h"
#include <grpc/byte_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/slice_buffer.h>
#include "src/core/profiling/timers.h"
#include "src/core/support/string.h"
#include "src/core/transport/transport.h"
#define MAX_BUFFER_LENGTH 8192
@ -132,9 +132,17 @@ static char *con_get_peer(grpc_exec_ctx *exec_ctx, grpc_call_element *elem) {
}
static const grpc_channel_filter connected_channel_filter = {
con_start_transport_stream_op, con_start_transport_op, sizeof(call_data),
init_call_elem, set_pollset, destroy_call_elem, sizeof(channel_data),
init_channel_elem, destroy_channel_elem, con_get_peer, "connected",
con_start_transport_stream_op,
con_start_transport_op,
sizeof(call_data),
init_call_elem,
set_pollset,
destroy_call_elem,
sizeof(channel_data),
init_channel_elem,
destroy_channel_elem,
con_get_peer,
"connected",
};
static void bind_transport(grpc_channel_stack *channel_stack,

@ -242,7 +242,14 @@ static void destroy_channel_elem(grpc_exec_ctx *exec_ctx,
}
const grpc_channel_filter grpc_http_client_filter = {
hc_start_transport_op, grpc_channel_next_op, sizeof(call_data),
init_call_elem, grpc_call_stack_ignore_set_pollset, destroy_call_elem,
sizeof(channel_data), init_channel_elem, destroy_channel_elem,
grpc_call_next_get_peer, "http-client"};
hc_start_transport_op,
grpc_channel_next_op,
sizeof(call_data),
init_call_elem,
grpc_call_stack_ignore_set_pollset,
destroy_call_elem,
sizeof(channel_data),
init_channel_elem,
destroy_channel_elem,
grpc_call_next_get_peer,
"http-client"};

@ -227,7 +227,14 @@ static void destroy_channel_elem(grpc_exec_ctx *exec_ctx,
grpc_channel_element *elem) {}
const grpc_channel_filter grpc_http_server_filter = {
hs_start_transport_op, grpc_channel_next_op, sizeof(call_data),
init_call_elem, grpc_call_stack_ignore_set_pollset, destroy_call_elem,
sizeof(channel_data), init_channel_elem, destroy_channel_elem,
grpc_call_next_get_peer, "http-server"};
hs_start_transport_op,
grpc_channel_next_op,
sizeof(call_data),
init_call_elem,
grpc_call_stack_ignore_set_pollset,
destroy_call_elem,
sizeof(channel_data),
init_channel_elem,
destroy_channel_elem,
grpc_call_next_get_peer,
"http-server"};

@ -378,8 +378,14 @@ void pf_ping_one(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol,
}
static const grpc_lb_policy_vtable pick_first_lb_policy_vtable = {
pf_destroy, pf_shutdown, pf_pick, pf_cancel_pick, pf_ping_one, pf_exit_idle,
pf_check_connectivity, pf_notify_on_state_change};
pf_destroy,
pf_shutdown,
pf_pick,
pf_cancel_pick,
pf_ping_one,
pf_exit_idle,
pf_check_connectivity,
pf_notify_on_state_change};
static void pick_first_factory_ref(grpc_lb_policy_factory *factory) {}

@ -483,8 +483,14 @@ static void rr_ping_one(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol,
}
static const grpc_lb_policy_vtable round_robin_lb_policy_vtable = {
rr_destroy, rr_shutdown, rr_pick, rr_cancel_pick, rr_ping_one, rr_exit_idle,
rr_check_connectivity, rr_notify_on_state_change};
rr_destroy,
rr_shutdown,
rr_pick,
rr_cancel_pick,
rr_ping_one,
rr_exit_idle,
rr_check_connectivity,
rr_notify_on_state_change};
static void round_robin_factory_ref(grpc_lb_policy_factory *factory) {}

@ -44,9 +44,9 @@
#include "src/core/client_config/lb_policy_registry.h"
#include "src/core/client_config/resolver_registry.h"
#include "src/core/iomgr/resolve_address.h"
#include "src/core/json/json.h"
#include "src/core/support/string.h"
#include "src/core/surface/api_trace.h"
#include "src/core/json/json.h"
/** Zookeeper session expiration time in milliseconds */
#define GRPC_ZOOKEEPER_SESSION_TIMEOUT 15000

@ -185,8 +185,8 @@ static void connection_destroy(grpc_exec_ctx *exec_ctx, void *arg,
gpr_free(c);
}
void grpc_connected_subchannel_ref(grpc_connected_subchannel *c
GRPC_SUBCHANNEL_REF_EXTRA_ARGS) {
void grpc_connected_subchannel_ref(
grpc_connected_subchannel *c GRPC_SUBCHANNEL_REF_EXTRA_ARGS) {
GRPC_CHANNEL_STACK_REF(CHANNEL_STACK_FROM_CONNECTION(c), REF_REASON);
}
@ -227,8 +227,8 @@ static gpr_atm ref_mutate(grpc_subchannel *c, gpr_atm delta,
return old_val;
}
grpc_subchannel *grpc_subchannel_ref(grpc_subchannel *c
GRPC_SUBCHANNEL_REF_EXTRA_ARGS) {
grpc_subchannel *grpc_subchannel_ref(
grpc_subchannel *c GRPC_SUBCHANNEL_REF_EXTRA_ARGS) {
gpr_atm old_refs;
old_refs = ref_mutate(c, (1 << INTERNAL_REF_BITS),
0 REF_MUTATE_PURPOSE("STRONG_REF"));
@ -236,8 +236,8 @@ grpc_subchannel *grpc_subchannel_ref(grpc_subchannel *c
return c;
}
grpc_subchannel *grpc_subchannel_weak_ref(grpc_subchannel *c
GRPC_SUBCHANNEL_REF_EXTRA_ARGS) {
grpc_subchannel *grpc_subchannel_weak_ref(
grpc_subchannel *c GRPC_SUBCHANNEL_REF_EXTRA_ARGS) {
gpr_atm old_refs;
old_refs = ref_mutate(c, 1, 0 REF_MUTATE_PURPOSE("WEAK_REF"));
GPR_ASSERT(old_refs != 0);
@ -626,8 +626,8 @@ static void subchannel_call_destroy(grpc_exec_ctx *exec_ctx, void *call,
GPR_TIMER_END("grpc_subchannel_call_unref.destroy", 0);
}
void grpc_subchannel_call_ref(grpc_subchannel_call *c
GRPC_SUBCHANNEL_REF_EXTRA_ARGS) {
void grpc_subchannel_call_ref(
grpc_subchannel_call *c GRPC_SUBCHANNEL_REF_EXTRA_ARGS) {
GRPC_CALL_STACK_REF(SUBCHANNEL_CALL_TO_CALL_STACK(c), REF_REASON);
}

@ -83,25 +83,25 @@ typedef struct grpc_subchannel_args grpc_subchannel_args;
#define GRPC_SUBCHANNEL_REF_EXTRA_ARGS
#endif
grpc_subchannel *grpc_subchannel_ref(grpc_subchannel *channel
GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
grpc_subchannel *grpc_subchannel_ref(
grpc_subchannel *channel GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
grpc_subchannel *grpc_subchannel_ref_from_weak_ref(
grpc_subchannel *channel GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
void grpc_subchannel_unref(grpc_exec_ctx *exec_ctx,
grpc_subchannel *channel
GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
grpc_subchannel *grpc_subchannel_weak_ref(grpc_subchannel *channel
GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
grpc_subchannel *grpc_subchannel_weak_ref(
grpc_subchannel *channel GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
void grpc_subchannel_weak_unref(grpc_exec_ctx *exec_ctx,
grpc_subchannel *channel
GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
void grpc_connected_subchannel_ref(grpc_connected_subchannel *channel
GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
void grpc_connected_subchannel_ref(
grpc_connected_subchannel *channel GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
void grpc_connected_subchannel_unref(grpc_exec_ctx *exec_ctx,
grpc_connected_subchannel *channel
GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
void grpc_subchannel_call_ref(grpc_subchannel_call *call
GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
void grpc_subchannel_call_ref(
grpc_subchannel_call *call GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
void grpc_subchannel_call_unref(grpc_exec_ctx *exec_ctx,
grpc_subchannel_call *call
GRPC_SUBCHANNEL_REF_EXTRA_ARGS);

@ -37,11 +37,11 @@
#include <stdio.h>
#include <string.h>
#include "src/core/support/string.h"
#include <grpc/support/alloc.h>
#include <grpc/support/slice.h>
#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
#include "src/core/support/string.h"
static void fill_common_header(const grpc_httpcli_request *request,
gpr_strvec *buf) {

@ -34,8 +34,8 @@
#ifndef GRPC_CORE_HTTP_FORMAT_REQUEST_H
#define GRPC_CORE_HTTP_FORMAT_REQUEST_H
#include "src/core/http/httpcli.h"
#include <grpc/support/slice.h>
#include "src/core/http/httpcli.h"
gpr_slice grpc_httpcli_format_get_request(const grpc_httpcli_request *request);
gpr_slice grpc_httpcli_format_post_request(const grpc_httpcli_request *request,

@ -35,11 +35,11 @@
#include <string.h>
#include "src/core/security/handshake.h"
#include "src/core/support/string.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include "src/core/security/handshake.h"
#include "src/core/support/string.h"
#include "src/core/tsi/ssl_transport_security.h"
typedef struct {

@ -34,11 +34,11 @@
#ifndef GRPC_CORE_IOMGR_ENDPOINT_H
#define GRPC_CORE_IOMGR_ENDPOINT_H
#include "src/core/iomgr/pollset.h"
#include "src/core/iomgr/pollset_set.h"
#include <grpc/support/slice.h>
#include <grpc/support/slice_buffer.h>
#include <grpc/support/time.h>
#include "src/core/iomgr/pollset.h"
#include "src/core/iomgr/pollset_set.h"
/* An endpoint caps a streaming channel between two communicating processes.
Examples may be: a tcp socket, <stdin+stdout>, or some shared memory. */

@ -42,14 +42,14 @@
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/types.h>
#include "src/core/iomgr/tcp_posix.h"
#include "src/core/support/string.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include "src/core/iomgr/tcp_posix.h"
#include "src/core/support/string.h"
static void create_sockets(int sv[2]) {
int flags;

@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -34,16 +34,16 @@
#include <grpc/support/port_platform.h>
#ifdef GPR_WINSOCK_SOCKET
#include "src/core/iomgr/sockaddr_utils.h"
#include "src/core/iomgr/endpoint_pair.h"
#include "src/core/iomgr/sockaddr_utils.h"
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include "src/core/iomgr/tcp_windows.h"
#include "src/core/iomgr/socket_windows.h"
#include <grpc/support/log.h>
#include "src/core/iomgr/socket_windows.h"
#include "src/core/iomgr/tcp_windows.h"
static void create_sockets(SOCKET sv[2]) {
SOCKET svr_sock = INVALID_SOCKET;

@ -34,11 +34,11 @@
#ifndef GRPC_CORE_IOMGR_FD_POSIX_H
#define GRPC_CORE_IOMGR_FD_POSIX_H
#include "src/core/iomgr/iomgr_internal.h"
#include "src/core/iomgr/pollset.h"
#include <grpc/support/atm.h>
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
#include "src/core/iomgr/iomgr_internal.h"
#include "src/core/iomgr/pollset.h"
typedef struct grpc_fd grpc_fd;

@ -37,15 +37,15 @@
#include <winsock2.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/log_win32.h>
#include <grpc/support/alloc.h>
#include <grpc/support/thd.h>
#include "src/core/iomgr/timer.h"
#include "src/core/iomgr/iocp_windows.h"
#include "src/core/iomgr/iomgr_internal.h"
#include "src/core/iomgr/socket_windows.h"
#include "src/core/iomgr/timer.h"
static ULONG g_iocp_kick_token;
static OVERLAPPED g_iocp_custom_overlap;

@ -36,8 +36,8 @@
#include <stdbool.h>
#include "src/core/iomgr/iomgr.h"
#include <grpc/support/sync.h>
#include "src/core/iomgr/iomgr.h"
typedef struct grpc_iomgr_object {
char *name;

@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -35,9 +35,9 @@
#ifdef GPR_POSIX_SOCKET
#include "src/core/iomgr/iomgr_posix.h"
#include "src/core/debug/trace.h"
#include "src/core/iomgr/fd_posix.h"
#include "src/core/iomgr/iomgr_posix.h"
#include "src/core/iomgr/tcp_posix.h"
void grpc_iomgr_platform_init(void) {

@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -39,9 +39,9 @@
#include <grpc/support/log.h>
#include "src/core/iomgr/socket_windows.h"
#include "src/core/iomgr/iocp_windows.h"
#include "src/core/iomgr/iomgr.h"
#include "src/core/iomgr/socket_windows.h"
/* Windows' io manager is going to be fully designed using IO completion
ports. All of what we're doing here is basically make sure that

@ -38,8 +38,8 @@
#include <grpc/support/log.h>
#include <grpc/support/thd.h>
#include "src/core/iomgr/iomgr_internal.h"
#include "src/core/iomgr/iocp_windows.h"
#include "src/core/iomgr/iomgr_internal.h"
#include "src/core/iomgr/pollset.h"
#include "src/core/iomgr/pollset_windows.h"

@ -35,10 +35,10 @@
#define GRPC_CORE_IOMGR_SOCKADDR_POSIX_H
#include <arpa/inet.h>
#include <netdb.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <netdb.h>
#include <unistd.h>
#endif /* GRPC_CORE_IOMGR_SOCKADDR_POSIX_H */

@ -36,6 +36,8 @@
#include <winsock2.h>
#include <ws2tcpip.h>
// must be included after the above
#include <mswsock.h>
#endif /* GRPC_CORE_IOMGR_SOCKADDR_WIN32_H */

@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -38,23 +38,23 @@
#include "src/core/iomgr/socket_utils_posix.h"
#include <arpa/inet.h>
#include <limits.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <stdio.h>
#include <sys/types.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include "src/core/iomgr/sockaddr_utils.h"
#include "src/core/support/string.h"
#include <grpc/support/host_port.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include <grpc/support/sync.h>
#include "src/core/iomgr/sockaddr_utils.h"
#include "src/core/support/string.h"
/* set a socket to non blocking mode */
int grpc_set_socket_nonblocking(int fd, int non_blocking) {

@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -37,8 +37,8 @@
#include "src/core/iomgr/socket_utils_posix.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/types.h>
int grpc_accept4(int sockfd, struct sockaddr *addr, socklen_t *addrlen,
int nonblock, int cloexec) {

@ -34,8 +34,8 @@
#ifndef GRPC_CORE_IOMGR_SOCKET_UTILS_POSIX_H
#define GRPC_CORE_IOMGR_SOCKET_UTILS_POSIX_H
#include <unistd.h>
#include <sys/socket.h>
#include <unistd.h>
/* a wrapper for accept or accept4 */
int grpc_accept4(int sockfd, struct sockaddr *addr, socklen_t *addrlen,

@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -36,6 +36,8 @@
#ifdef GPR_WINSOCK_SOCKET
#include <winsock2.h>
// must be included after winsock2.h
#include <mswsock.h>
#include <grpc/support/alloc.h>

@ -37,11 +37,11 @@
#include <grpc/support/port_platform.h>
#include <winsock2.h>
#include <grpc/support/sync.h>
#include <grpc/support/atm.h>
#include <grpc/support/sync.h>
#include "src/core/iomgr/iomgr_internal.h"
#include "src/core/iomgr/exec_ctx.h"
#include "src/core/iomgr/iomgr_internal.h"
/* This holds the data for an outstanding read or write on a socket.
The mutex to protect the concurrent access to that data is the one

@ -34,10 +34,10 @@
#ifndef GRPC_CORE_IOMGR_TCP_CLIENT_H
#define GRPC_CORE_IOMGR_TCP_CLIENT_H
#include <grpc/support/time.h>
#include "src/core/iomgr/endpoint.h"
#include "src/core/iomgr/pollset_set.h"
#include "src/core/iomgr/sockaddr.h"
#include <grpc/support/time.h>
/* Asynchronously connect to an address (specified as (addr, len)), and call
cb with arg and the completed connection when done (or call cb with arg and

@ -43,13 +43,13 @@
#include <grpc/support/slice_buffer.h>
#include <grpc/support/useful.h>
#include "src/core/iomgr/timer.h"
#include "src/core/iomgr/iocp_windows.h"
#include "src/core/iomgr/tcp_client.h"
#include "src/core/iomgr/tcp_windows.h"
#include "src/core/iomgr/sockaddr.h"
#include "src/core/iomgr/sockaddr_utils.h"
#include "src/core/iomgr/socket_windows.h"
#include "src/core/iomgr/tcp_client.h"
#include "src/core/iomgr/tcp_windows.h"
#include "src/core/iomgr/timer.h"
typedef struct {
grpc_closure *on_done;

@ -297,7 +297,7 @@ static flush_result tcp_flush(grpc_tcp *tcp) {
unwind_slice_idx = tcp->outgoing_slice_idx;
unwind_byte_idx = tcp->outgoing_byte_idx;
for (iov_size = 0; tcp->outgoing_slice_idx != tcp->outgoing_buffer->count &&
iov_size != MAX_WRITE_IOVEC;
iov_size != MAX_WRITE_IOVEC;
iov_size++) {
iov[iov_size].iov_base =
GPR_SLICE_START_PTR(
@ -446,7 +446,7 @@ static char *tcp_get_peer(grpc_endpoint *ep) {
}
static const grpc_endpoint_vtable vtable = {
tcp_read, tcp_write, tcp_add_to_pollset, tcp_add_to_pollset_set,
tcp_read, tcp_write, tcp_add_to_pollset, tcp_add_to_pollset_set,
tcp_shutdown, tcp_destroy, tcp_get_peer};
grpc_endpoint *grpc_tcp_create(grpc_fd *em_fd, size_t slice_size,

@ -54,6 +54,11 @@
#include <sys/types.h>
#include <unistd.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
#include "src/core/iomgr/pollset_posix.h"
#include "src/core/iomgr/resolve_address.h"
#include "src/core/iomgr/sockaddr_utils.h"
@ -61,11 +66,6 @@
#include "src/core/iomgr/tcp_posix.h"
#include "src/core/iomgr/unix_sockets_posix.h"
#include "src/core/support/string.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
#define MIN_SAFE_ACCEPT_QUEUE_SIZE 100

@ -44,12 +44,12 @@
#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
#include "src/core/iomgr/timer.h"
#include "src/core/iomgr/iocp_windows.h"
#include "src/core/iomgr/sockaddr.h"
#include "src/core/iomgr/sockaddr_utils.h"
#include "src/core/iomgr/socket_windows.h"
#include "src/core/iomgr/tcp_client.h"
#include "src/core/iomgr/timer.h"
static int set_non_block(SOCKET sock) {
int status;
@ -382,9 +382,9 @@ static char *win_get_peer(grpc_endpoint *ep) {
return gpr_strdup(tcp->peer_string);
}
static grpc_endpoint_vtable vtable = {win_read, win_write, win_add_to_pollset,
win_add_to_pollset_set, win_shutdown,
win_destroy, win_get_peer};
static grpc_endpoint_vtable vtable = {
win_read, win_write, win_add_to_pollset, win_add_to_pollset_set,
win_shutdown, win_destroy, win_get_peer};
grpc_endpoint *grpc_tcp_create(grpc_winsocket *socket, char *peer_string) {
grpc_tcp *tcp = (grpc_tcp *)gpr_malloc(sizeof(grpc_tcp));

@ -34,10 +34,10 @@
#ifndef GRPC_CORE_IOMGR_TIMER_H
#define GRPC_CORE_IOMGR_TIMER_H
#include "src/core/iomgr/iomgr.h"
#include "src/core/iomgr/exec_ctx.h"
#include <grpc/support/port_platform.h>
#include <grpc/support/time.h>
#include "src/core/iomgr/exec_ctx.h"
#include "src/core/iomgr/iomgr.h"
typedef struct grpc_timer {
gpr_timespec deadline;

@ -54,6 +54,12 @@
#include <sys/types.h>
#include <unistd.h>
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
#include "src/core/iomgr/fd_posix.h"
#include "src/core/iomgr/pollset_posix.h"
#include "src/core/iomgr/resolve_address.h"
@ -61,12 +67,6 @@
#include "src/core/iomgr/socket_utils_posix.h"
#include "src/core/iomgr/unix_sockets_posix.h"
#include "src/core/support/string.h"
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
#include <grpc/support/string_util.h>
#include <grpc/support/time.h>
#define INIT_PORT_CAP 2

@ -36,8 +36,8 @@
#ifdef GPR_HAVE_UNIX_SOCKET
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/un.h>
#include <grpc/support/alloc.h>

@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -40,8 +40,8 @@
#ifdef GPR_POSIX_NO_SPECIAL_WAKEUP_FD
#include "src/core/iomgr/wakeup_fd_posix.h"
#include <stddef.h>
#include "src/core/iomgr/wakeup_fd_posix.h"
static int check_availability_invalid(void) { return 0; }

@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -35,9 +35,9 @@
#ifdef GPR_POSIX_WAKEUP_FD
#include "src/core/iomgr/wakeup_fd_posix.h"
#include "src/core/iomgr/wakeup_fd_pipe.h"
#include <stddef.h>
#include "src/core/iomgr/wakeup_fd_pipe.h"
#include "src/core/iomgr/wakeup_fd_posix.h"
static const grpc_wakeup_fd_vtable *wakeup_fd_vtable = NULL;
int grpc_allow_specialized_wakeup_fd = 1;

@ -34,10 +34,10 @@
#ifndef GRPC_CORE_IOMGR_WORKQUEUE_H
#define GRPC_CORE_IOMGR_WORKQUEUE_H
#include "src/core/iomgr/iomgr.h"
#include "src/core/iomgr/pollset.h"
#include "src/core/iomgr/closure.h"
#include "src/core/iomgr/exec_ctx.h"
#include "src/core/iomgr/iomgr.h"
#include "src/core/iomgr/pollset.h"
#ifdef GPR_POSIX_SOCKET
#include "src/core/iomgr/workqueue_posix.h"

@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -31,8 +31,8 @@
*
*/
#include <string.h>
#include <stdlib.h>
#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>

@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -39,9 +39,9 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/time.h>
#include <grpc/support/sync.h>
#include <grpc/support/thd.h>
#include <grpc/support/time.h>
#include <stdio.h>
typedef enum { BEGIN = '{', END = '}', MARK = '.' } marker_type;

@ -331,6 +331,6 @@ static void destroy_channel_elem(grpc_exec_ctx *exec_ctx,
const grpc_channel_filter grpc_client_auth_filter = {
auth_start_transport_op, grpc_channel_next_op, sizeof(call_data),
init_call_elem, set_pollset, destroy_call_elem, sizeof(channel_data),
init_channel_elem, destroy_channel_elem, grpc_call_next_get_peer,
"client-auth"};
init_call_elem, set_pollset, destroy_call_elem,
sizeof(channel_data), init_channel_elem, destroy_channel_elem,
grpc_call_next_get_peer, "client-auth"};

@ -38,8 +38,8 @@
#include "src/core/channel/channel_args.h"
#include "src/core/channel/http_client_filter.h"
#include "src/core/http/parser.h"
#include "src/core/http/httpcli.h"
#include "src/core/http/parser.h"
#include "src/core/iomgr/executor.h"
#include "src/core/json/json.h"
#include "src/core/support/string.h"

@ -34,10 +34,10 @@
#ifndef GRPC_CORE_SECURITY_CREDENTIALS_H
#define GRPC_CORE_SECURITY_CREDENTIALS_H
#include "src/core/transport/metadata_batch.h"
#include <grpc/grpc.h>
#include <grpc/grpc_security.h>
#include <grpc/support/sync.h>
#include "src/core/transport/metadata_batch.h"
#include "src/core/http/httpcli.h"
#include "src/core/http/parser.h"

@ -36,11 +36,11 @@
#include <stdbool.h>
#include <string.h>
#include "src/core/security/security_context.h"
#include "src/core/security/secure_endpoint.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/slice_buffer.h>
#include "src/core/security/secure_endpoint.h"
#include "src/core/security/security_context.h"
#define GRPC_INITIAL_HANDSHAKE_BUFFER_SIZE 256

@ -32,14 +32,14 @@
*/
#include "src/core/security/secure_endpoint.h"
#include "src/core/support/string.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/slice_buffer.h>
#include <grpc/support/slice.h>
#include <grpc/support/slice_buffer.h>
#include <grpc/support/sync.h>
#include "src/core/tsi/transport_security_interface.h"
#include "src/core/debug/trace.h"
#include "src/core/support/string.h"
#include "src/core/tsi/transport_security_interface.h"
#define STAGING_BUFFER_SIZE 8192
@ -354,8 +354,9 @@ static char *endpoint_get_peer(grpc_endpoint *secure_ep) {
}
static const grpc_endpoint_vtable vtable = {
endpoint_read, endpoint_write, endpoint_add_to_pollset,
endpoint_add_to_pollset_set, endpoint_shutdown, endpoint_destroy,
endpoint_read, endpoint_write,
endpoint_add_to_pollset, endpoint_add_to_pollset_set,
endpoint_shutdown, endpoint_destroy,
endpoint_get_peer};
grpc_endpoint *grpc_secure_endpoint_create(

@ -34,8 +34,8 @@
#ifndef GRPC_CORE_SECURITY_SECURE_ENDPOINT_H
#define GRPC_CORE_SECURITY_SECURE_ENDPOINT_H
#include "src/core/iomgr/endpoint.h"
#include <grpc/support/slice.h>
#include "src/core/iomgr/endpoint.h"
struct tsi_frame_protector;

@ -34,9 +34,9 @@
#include <string.h>
#include "src/core/security/security_context.h"
#include "src/core/support/string.h"
#include "src/core/surface/api_trace.h"
#include "src/core/surface/call.h"
#include "src/core/support/string.h"
#include <grpc/grpc_security.h>
#include <grpc/support/alloc.h>

@ -259,6 +259,6 @@ static void destroy_channel_elem(grpc_exec_ctx *exec_ctx,
const grpc_channel_filter grpc_server_auth_filter = {
auth_start_transport_op, grpc_channel_next_op, sizeof(call_data),
init_call_elem, set_pollset, destroy_call_elem, sizeof(channel_data),
init_channel_elem, destroy_channel_elem, grpc_call_next_get_peer,
"server-auth"};
init_call_elem, set_pollset, destroy_call_elem,
sizeof(channel_data), init_channel_elem, destroy_channel_elem,
grpc_call_next_get_peer, "server-auth"};

@ -35,6 +35,10 @@
#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
#include <grpc/support/useful.h>
#include "src/core/channel/channel_args.h"
#include "src/core/channel/http_server_filter.h"
#include "src/core/iomgr/endpoint.h"
@ -47,10 +51,6 @@
#include "src/core/surface/api_trace.h"
#include "src/core/surface/server.h"
#include "src/core/transport/chttp2_transport.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
#include <grpc/support/useful.h>
typedef struct grpc_server_secure_state {
grpc_server *server;

@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -90,7 +90,6 @@
argument. E.g. cl_block_initialize() will initialize a cl_block.
*/
#include "src/core/statistics/census_log.h"
#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/support/atm.h>
#include <grpc/support/cpu.h>
@ -98,6 +97,7 @@
#include <grpc/support/port_platform.h>
#include <grpc/support/sync.h>
#include <grpc/support/useful.h>
#include <string.h>
/* End of platform specific code */

@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -33,16 +33,16 @@
#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
#include "src/core/statistics/census_interface.h"
#include "src/core/statistics/census_rpc_stats.h"
#include "src/core/statistics/hash_table.h"
#include "src/core/statistics/census_tracing.h"
#include "src/core/statistics/hash_table.h"
#include "src/core/statistics/window_stats.h"
#include "src/core/support/murmur_hash.h"
#include "src/core/support/string.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
#define NUM_INTERVALS 3
#define MINUTE_INTERVAL 0
@ -85,8 +85,8 @@ static void delete_key(void *key) { gpr_free(key); }
static const census_ht_option ht_opt = {
CENSUS_HT_POINTER /* key type */, 1999 /* n_of_buckets */,
simple_hash /* hash function */, cmp_str_keys /* key comparator */,
delete_stats /* data deleter */, delete_key /* key deleter */
simple_hash /* hash function */, cmp_str_keys /* key comparator */,
delete_stats /* data deleter */, delete_key /* key deleter */
};
static void init_rpc_stats(void *stats) {

@ -34,8 +34,8 @@
#ifndef GRPC_CORE_STATISTICS_CENSUS_RPC_STATS_H
#define GRPC_CORE_STATISTICS_CENSUS_RPC_STATS_H
#include "src/core/statistics/census_interface.h"
#include <grpc/support/port_platform.h>
#include "src/core/statistics/census_interface.h"
#ifdef __cplusplus
extern "C" {

@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -31,18 +31,18 @@
*
*/
#include "src/core/statistics/census_interface.h"
#include "src/core/statistics/census_tracing.h"
#include "src/core/statistics/census_interface.h"
#include <stdio.h>
#include <string.h>
#include "src/core/statistics/hash_table.h"
#include "src/core/support/string.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include <grpc/support/sync.h>
#include "src/core/statistics/hash_table.h"
#include "src/core/support/string.h"
void census_trace_obj_destroy(census_trace_obj *obj) {
census_trace_annotation *p = obj->annotations;
@ -60,8 +60,11 @@ static void delete_trace_obj(void *obj) {
}
static const census_ht_option ht_opt = {
CENSUS_HT_UINT64 /* key type */, 571 /* n_of_buckets */, NULL /* hash */,
NULL /* compare_keys */, delete_trace_obj /* delete data */,
CENSUS_HT_UINT64 /* key type */,
571 /* n_of_buckets */,
NULL /* hash */,
NULL /* compare_keys */,
delete_trace_obj /* delete data */,
NULL /* delete key */
};

@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -33,11 +33,11 @@
#include "src/core/statistics/hash_table.h"
#include <stdio.h>
#include <stddef.h>
#include <stdio.h>
#include <grpc/support/log.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#define CENSUS_HT_NUM_BUCKETS 1999

@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -32,13 +32,13 @@
*/
#include "src/core/statistics/window_stats.h"
#include <math.h>
#include <stddef.h>
#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/time.h>
#include <grpc/support/useful.h>
#include <math.h>
#include <stddef.h>
#include <string.h>
/* typedefs make typing long names easier. Use cws (for census_window_stats) */
typedef census_window_stats_stat_info cws_stat_info;

@ -33,9 +33,9 @@
#include <grpc/support/alloc.h>
#include <stdlib.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include <stdlib.h>
#include "src/core/profiling/timers.h"
static gpr_allocation_functions g_alloc_functions = {malloc, realloc, free};

@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -37,10 +37,10 @@
#include <stdio.h>
#include <string.h>
#include "src/core/support/string.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include "src/core/support/string.h"
typedef enum { ARGTYPE_INT, ARGTYPE_BOOL, ARGTYPE_STRING } argtype;

@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -39,10 +39,10 @@
#ifdef GPR_CPU_LINUX
#include <sched.h>
#include <errno.h>
#include <unistd.h>
#include <sched.h>
#include <string.h>
#include <unistd.h>
#include <grpc/support/cpu.h>
#include <grpc/support/log.h>

@ -36,8 +36,8 @@
#ifdef GPR_CPU_POSIX
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <unistd.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>

@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,8 +41,8 @@
#include <grpc/support/log.h>
#include "src/core/support/string.h"
#include <grpc/support/string_util.h>
#include "src/core/support/string.h"
char *gpr_getenv(const char *name) {
char *result = getenv(name);

@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -38,8 +38,8 @@
#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/support/port_platform.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include <grpc/support/useful.h>
/* Histograms are stored with exponentially increasing bucket sizes.

@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -35,10 +35,10 @@
#include <string.h>
#include "src/core/support/string.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include "src/core/support/string.h"
int gpr_join_host_port(char **out, const char *host, int port) {
if (host[0] != '[' && strchr(host, ':') != NULL) {

@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -35,12 +35,12 @@
#ifdef GPR_ANDROID
#include <android/log.h>
#include <grpc/support/log.h>
#include <grpc/support/time.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <android/log.h>
static android_LogPriority severity_to_log_priority(gpr_log_severity severity) {
switch (severity) {

@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -47,12 +47,12 @@
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/time.h>
#include <stdio.h>
#include <linux/unistd.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <linux/unistd.h>
#include <sys/syscall.h>
#include <time.h>
#include <unistd.h>
static long gettid(void) { return syscall(__NR_gettid); }

@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -38,12 +38,12 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/time.h>
#include <stdio.h>
#include <pthread.h>
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <pthread.h>
static intptr_t gettid(void) { return (intptr_t)pthread_self(); }

@ -35,14 +35,14 @@
#ifdef GPR_WIN32
#include <stdio.h>
#include <stdarg.h>
#include <stdio.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log_win32.h>
#include <grpc/support/log.h>
#include <grpc/support/time.h>
#include <grpc/support/log_win32.h>
#include <grpc/support/string_util.h>
#include <grpc/support/time.h>
#include "src/core/support/string.h"
#include "src/core/support/string_win32.h"

@ -36,10 +36,10 @@
#include <stdlib.h>
#include <string.h>
#include <grpc/support/port_platform.h>
#include <grpc/support/alloc.h>
#include <grpc/support/atm.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
/* The lockfree node structure is a single architecture-level
word that allows for an atomic CAS to set it up. */
@ -64,10 +64,10 @@ typedef union lockfree_node {
struct lockfree_node_contents contents;
} lockfree_node;
#define ENTRY_ALIGNMENT_BITS 3 /* make sure that entries aligned to 8-bytes */
#define INVALID_ENTRY_INDEX \
((1 << 16) - 1) /* reserve this entry as invalid \
*/
/* make sure that entries aligned to 8-bytes */
#define ENTRY_ALIGNMENT_BITS 3
/* reserve this entry as invalid */
#define INVALID_ENTRY_INDEX ((1 << 16) - 1)
struct gpr_stack_lockfree {
lockfree_node *entries;

@ -37,8 +37,8 @@
#include <stddef.h>
#include <grpc/support/port_platform.h>
#include <grpc/support/slice_buffer.h>
#include <grpc/support/slice.h>
#include <grpc/support/slice_buffer.h>
#ifdef __cplusplus
extern "C" {

@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -35,8 +35,8 @@
#ifdef GPR_POSIX_STRING
#include <stdio.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <grpc/support/alloc.h>

@ -37,8 +37,8 @@
#ifdef GPR_WIN32
#include <stdio.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <grpc/support/alloc.h>

@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -37,15 +37,15 @@
#include <grpc/support/subprocess.h>
#include <unistd.h>
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>

@ -35,9 +35,9 @@
#ifdef GPR_WINDOWS_SUBPROCESS
#include <windows.h>
#include <string.h>
#include <tchar.h>
#include <windows.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>

@ -33,9 +33,9 @@
/* Generic implementation of synchronization primitives. */
#include <grpc/support/atm.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
#include <grpc/support/atm.h>
/* Number of mutexes to allocate for events, to avoid lock contention.
Should be a prime. */

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save