Skip to content

Commit

Permalink
Sync c-core 1.65.0-pre1
Browse files Browse the repository at this point in the history
  • Loading branch information
HannahShiSFB committed Jun 15, 2024
1 parent 7108818 commit 21f872a
Show file tree
Hide file tree
Showing 659 changed files with 40,666 additions and 16,807 deletions.
149 changes: 80 additions & 69 deletions gRPC-C++.podspec

Large diffs are not rendered by default.

254 changes: 130 additions & 124 deletions gRPC-Core.podspec

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion gRPC-ProtoRPC.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

Pod::Spec.new do |s|
s.name = 'gRPC-ProtoRPC'
version = '1.65.0-dev'
version = '1.65.0-pre1'
s.version = version
s.summary = 'RPC library for Protocol Buffers, based on gRPC'
s.homepage = 'https://grpc.io'
Expand Down
2 changes: 1 addition & 1 deletion gRPC-RxLibrary.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

Pod::Spec.new do |s|
s.name = 'gRPC-RxLibrary'
version = '1.65.0-dev'
version = '1.65.0-pre1'
s.version = version
s.summary = 'Reactive Extensions library for iOS/OSX.'
s.homepage = 'https://grpc.io'
Expand Down
2 changes: 1 addition & 1 deletion gRPC.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

Pod::Spec.new do |s|
s.name = 'gRPC'
version = '1.65.0-dev'
version = '1.65.0-pre1'
s.version = version
s.summary = 'gRPC client library for iOS/OSX'
s.homepage = 'https://grpc.io'
Expand Down
19 changes: 13 additions & 6 deletions include/grpc/event_engine/event_engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,19 +132,13 @@ class EventEngine : public std::enable_shared_from_this<EventEngine>,
struct TaskHandle {
intptr_t keys[2];
static const GRPC_DLL TaskHandle kInvalid;
friend bool operator==(const TaskHandle& lhs, const TaskHandle& rhs);
friend bool operator!=(const TaskHandle& lhs, const TaskHandle& rhs);
};
/// A handle to a cancellable connection attempt.
///
/// Returned by \a Connect, and can be passed to \a CancelConnect.
struct ConnectionHandle {
intptr_t keys[2];
static const GRPC_DLL ConnectionHandle kInvalid;
friend bool operator==(const ConnectionHandle& lhs,
const ConnectionHandle& rhs);
friend bool operator!=(const ConnectionHandle& lhs,
const ConnectionHandle& rhs);
};
/// Thin wrapper around a platform-specific sockaddr type. A sockaddr struct
/// exists on all platforms that gRPC supports.
Expand Down Expand Up @@ -496,6 +490,19 @@ void EventEngineFactoryReset();
/// Create an EventEngine using the default factory.
std::unique_ptr<EventEngine> CreateEventEngine();

bool operator==(const EventEngine::TaskHandle& lhs,
const EventEngine::TaskHandle& rhs);
bool operator!=(const EventEngine::TaskHandle& lhs,
const EventEngine::TaskHandle& rhs);
std::ostream& operator<<(std::ostream& out,
const EventEngine::TaskHandle& handle);
bool operator==(const EventEngine::ConnectionHandle& lhs,
const EventEngine::ConnectionHandle& rhs);
bool operator!=(const EventEngine::ConnectionHandle& lhs,
const EventEngine::ConnectionHandle& rhs);
std::ostream& operator<<(std::ostream& out,
const EventEngine::ConnectionHandle& handle);

} // namespace experimental
} // namespace grpc_event_engine

Expand Down
37 changes: 37 additions & 0 deletions include/grpc/grpc_cronet.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
*
* Copyright 2016 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

#ifndef GRPC_GRPC_CRONET_H
#define GRPC_GRPC_CRONET_H

#include <grpc/grpc.h>
#include <grpc/support/port_platform.h>

#ifdef __cplusplus
extern "C" {
#endif

GRPCAPI grpc_channel* grpc_cronet_secure_channel_create(
void* engine, const char* target, const grpc_channel_args* args,
void* reserved);

#ifdef __cplusplus
}
#endif

#endif /* GRPC_GRPC_CRONET_H */
10 changes: 7 additions & 3 deletions include/grpc/impl/channel_arg_names.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,11 @@
"grpc.server_max_unrequested_time_in_server"
/** Channel arg to override the http2 :scheme header */
#define GRPC_ARG_HTTP2_SCHEME "grpc.http2_scheme"
/** How many pings can the client send before needing to send a
data/header frame? (0 indicates that an infinite number of
pings can be sent without sending a data frame or header frame) */
/** How many pings can the client send before needing to send a data/header
frame? (0 indicates that an infinite number of pings can be sent without
sending a data frame or header frame).
If experiment "max_pings_wo_data_throttle" is enabled, instead of pings being
completely blocked, they are throttled. */
#define GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA \
"grpc.http2.max_pings_without_data"
/** How many misbehaving pings the server can bear before sending goaway and
Expand Down Expand Up @@ -396,6 +398,8 @@
* If unspecified, it is unlimited */
#define GRPC_ARG_MAX_ALLOWED_INCOMING_CONNECTIONS \
"grpc.max_allowed_incoming_connections"
/** Configure per-channel or per-server stats plugins. */
#define GRPC_ARG_EXPERIMENTAL_STATS_PLUGINS "grpc.experimental.stats_plugins"
/** \} */

#endif /* GRPC_IMPL_CHANNEL_ARG_NAMES_H */
1 change: 1 addition & 0 deletions include/grpc/module.modulemap
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ header "byte_buffer.h"
header "impl/propagation_bits.h"
header "impl/slice_type.h"
header "load_reporting.h"
header "passive_listener.h"
header "slice.h"
header "slice_buffer.h"
header "status.h"
Expand Down
62 changes: 62 additions & 0 deletions include/grpc/passive_listener.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// Copyright 2024 The gRPC Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef GRPC_PASSIVE_LISTENER_H
#define GRPC_PASSIVE_LISTENER_H

#include <memory>

#include <grpc/event_engine/event_engine.h>
#include <grpc/grpc.h>
// #include <grpc/support/port_platform.h>

namespace grpc_core {
class Server;

namespace experimental {
class PassiveListenerImpl;

/// -- EXPERIMENTAL API --
/// Interface for used for Server Endpoint injection.
class PassiveListener {
public:
virtual ~PassiveListener() = default;
/// -- EXPERIMENTAL API --
///
/// Takes an Endpoint for an established connection, and treats it as if the
/// connection had been accepted by the server.
///
/// The server must be started before endpoints can be accepted.
virtual absl::Status AcceptConnectedEndpoint(
std::unique_ptr<grpc_event_engine::experimental::EventEngine::Endpoint>
endpoint) = 0;

/// -- EXPERIMENTAL API --
///
/// Takes a connected file descriptor, and treats it as if the server had
/// accepted the connection itself.
///
/// Returns a failure status if the server's active EventEngine does not
/// support Endpoint creation from fds.
virtual absl::Status AcceptConnectedFd(int fd) = 0;
};

} // namespace experimental
} // namespace grpc_core

absl::Status grpc_server_add_passive_listener(
grpc_core::Server* server, grpc_server_credentials* credentials,
std::shared_ptr<grpc_core::experimental::PassiveListenerImpl>
passive_listener);

#endif /* GRPC_PASSIVE_LISTENER_H */
7 changes: 1 addition & 6 deletions include/grpc/support/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ struct gpr_log_func_args {
typedef struct gpr_log_func_args gpr_log_func_args;

typedef void (*gpr_log_func)(gpr_log_func_args* args);

GPRAPI void gpr_set_log_function(gpr_log_func func);

GPRAPI void gpr_assertion_failed(const char* filename, int line,
Expand All @@ -99,12 +100,6 @@ GPRAPI void gpr_assertion_failed(const char* filename, int line,
} \
} while (0)

#ifndef NDEBUG
#define GPR_DEBUG_ASSERT(x) GPR_ASSERT(x)
#else
#define GPR_DEBUG_ASSERT(x) GPR_ASSERT(true || (x))
#endif

#ifdef __cplusplus
}
#endif
Expand Down
3 changes: 3 additions & 0 deletions include/grpc/support/port_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,9 @@
#define GPR_PLATFORM_STRING "ios"
#define GPR_CPU_IPHONE 1
#define GRPC_CFSTREAM 1
#ifndef GRPC_IOS_EVENT_ENGINE_CLIENT
#define GRPC_IOS_EVENT_ENGINE_CLIENT 1
#endif /* GRPC_IOS_EVENT_ENGINE_CLIENT */
/* the c-ares resolver isn't safe to enable on iOS */
#define GRPC_ARES 0
#else /* TARGET_OS_IPHONE */
Expand Down
4 changes: 2 additions & 2 deletions include/grpcpp/client_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <memory>
#include <string>

#include "absl/log/check.h"
#include "absl/log/absl_check.h"

#include <grpc/impl/compression_types.h>
#include <grpc/impl/propagation_bits.h>
Expand Down Expand Up @@ -248,7 +248,7 @@ class ClientContext {
/// \return A multimap of initial metadata key-value pairs from the server.
const std::multimap<grpc::string_ref, grpc::string_ref>&
GetServerInitialMetadata() const {
CHECK(initial_metadata_received_);
ABSL_CHECK(initial_metadata_received_);
return *recv_initial_metadata_.map();
}

Expand Down
8 changes: 4 additions & 4 deletions include/grpcpp/completion_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

#include <list>

#include "absl/log/check.h"
#include "absl/log/absl_check.h"

#include <grpc/grpc.h>
#include <grpc/support/atm.h>
Expand Down Expand Up @@ -325,7 +325,7 @@ class CompletionQueue : private grpc::internal::GrpcLibrary {
bool ok = ev.success != 0;
void* ignored = tag;
if (tag->FinalizeResult(&ignored, &ok)) {
CHECK(ignored == tag);
ABSL_CHECK(ignored == tag);
return ok;
}
}
Expand All @@ -346,7 +346,7 @@ class CompletionQueue : private grpc::internal::GrpcLibrary {
bool ok = ev.success != 0;
void* ignored = tag;
// the tag must be swallowed if using TryPluck
CHECK(!tag->FinalizeResult(&ignored, &ok));
ABSL_CHECK(!tag->FinalizeResult(&ignored, &ok));
}

/// Performs a single polling pluck on \a tag. Calls tag->FinalizeResult if
Expand All @@ -363,7 +363,7 @@ class CompletionQueue : private grpc::internal::GrpcLibrary {

bool ok = ev.success != 0;
void* ignored = tag;
CHECK(!tag->FinalizeResult(&ignored, &ok));
ABSL_CHECK(!tag->FinalizeResult(&ignored, &ok));
}

/// Manage state of avalanching operations : completion queue tags that
Expand Down
22 changes: 12 additions & 10 deletions include/grpcpp/impl/call_op_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
#include <map>
#include <memory>

#include "absl/log/check.h"
#include "absl/log/absl_check.h"
#include "absl/log/absl_log.h"

#include <grpc/grpc.h>
#include <grpc/impl/compression_types.h>
#include <grpc/impl/grpc_types.h>
#include <grpc/slice.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpcpp/client_context.h>
#include <grpcpp/completion_queue.h>
#include <grpcpp/impl/call.h>
Expand Down Expand Up @@ -318,7 +318,7 @@ class CallOpSendMessage {
return;
}
if (msg_ != nullptr) {
CHECK(serializer_(msg_).ok());
ABSL_CHECK(serializer_(msg_).ok());
}
serializer_ = nullptr;
grpc_op* op = &ops[(*nops)++];
Expand Down Expand Up @@ -771,7 +771,9 @@ class CallOpRecvInitialMetadata {
class CallOpClientRecvStatus {
public:
CallOpClientRecvStatus()
: recv_status_(nullptr), debug_error_string_(nullptr) {}
: metadata_map_(nullptr),
recv_status_(nullptr),
debug_error_string_(nullptr) {}

void ClientRecvStatus(grpc::ClientContext* context, Status* status) {
client_context_ = context;
Expand All @@ -797,7 +799,7 @@ class CallOpClientRecvStatus {
if (recv_status_ == nullptr || hijacked_) return;
if (static_cast<StatusCode>(status_code_) == StatusCode::OK) {
*recv_status_ = Status();
DCHECK_EQ(debug_error_string_, nullptr);
ABSL_DCHECK_EQ(debug_error_string_, nullptr);
} else {
*recv_status_ =
Status(static_cast<StatusCode>(status_code_),
Expand Down Expand Up @@ -974,9 +976,9 @@ class CallOpSet : public CallOpSetInterface,
// A failure here indicates an API misuse; for example, doing a Write
// while another Write is already pending on the same RPC or invoking
// WritesDone multiple times
gpr_log(GPR_ERROR, "API misuse of type %s observed",
grpc_call_error_to_string(err));
CHECK(false);
ABSL_LOG(ERROR) << "API misuse of type " << grpc_call_error_to_string(err)
<< " observed";
ABSL_CHECK(false);
}
}

Expand All @@ -986,8 +988,8 @@ class CallOpSet : public CallOpSetInterface,
done_intercepting_ = true;
// The following call_start_batch is internally-generated so no need for an
// explanatory log on failure.
CHECK(grpc_call_start_batch(call_.call(), nullptr, 0, core_cq_tag(),
nullptr) == GRPC_CALL_OK);
ABSL_CHECK(grpc_call_start_batch(call_.call(), nullptr, 0, core_cq_tag(),
nullptr) == GRPC_CALL_OK);
}

private:
Expand Down
Loading

0 comments on commit 21f872a

Please sign in to comment.