Skip to content
Snippets Groups Projects
Commit f6f153d0 authored by Sree Kuchibhotla's avatar Sree Kuchibhotla
Browse files

temporarily port #7833

parent 7974232f
No related branches found
No related tags found
No related merge requests found
...@@ -57,11 +57,13 @@ GRPCAPI grpc_channel *grpc_insecure_channel_create_from_fd( ...@@ -57,11 +57,13 @@ GRPCAPI grpc_channel *grpc_insecure_channel_create_from_fd(
/** Add the connected communication channel based on file descriptor 'fd' to the /** Add the connected communication channel based on file descriptor 'fd' to the
'server'. The 'fd' must be an open file descriptor corresponding to a 'server'. The 'fd' must be an open file descriptor corresponding to a
connected socket. The 'cq' is a completion queue that will be getting events connected socket. Events from the file descriptor may come on any of the
from that descriptor. */ server completion queues (i.e completion queues registered via the
grpc_server_register_completion_queue API).
The 'reserved' pointer MUST be NULL */
GRPCAPI void grpc_server_add_insecure_channel_from_fd(grpc_server *server, GRPCAPI void grpc_server_add_insecure_channel_from_fd(grpc_server *server,
grpc_completion_queue *cq, void *reserved, int fd);
int fd);
/** GRPC Core POSIX library may internally use signals to optimize some work. /** GRPC Core POSIX library may internally use signals to optimize some work.
The library uses (SIGRTMIN + 2) signal by default. Use this API to instruct The library uses (SIGRTMIN + 2) signal by default. Use this API to instruct
......
...@@ -50,8 +50,10 @@ ...@@ -50,8 +50,10 @@
#include "src/core/lib/surface/server.h" #include "src/core/lib/surface/server.h"
void grpc_server_add_insecure_channel_from_fd(grpc_server *server, void grpc_server_add_insecure_channel_from_fd(grpc_server *server,
grpc_completion_queue *cq, void *reserved,
int fd) { int fd) {
GPR_ASSERT(reserved == NULL);
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
char *name; char *name;
...@@ -74,7 +76,6 @@ void grpc_server_add_insecure_channel_from_fd(grpc_server *server, ...@@ -74,7 +76,6 @@ void grpc_server_add_insecure_channel_from_fd(grpc_server *server,
grpc_endpoint_add_to_pollset(&exec_ctx, server_endpoint, pollsets[i]); grpc_endpoint_add_to_pollset(&exec_ctx, server_endpoint, pollsets[i]);
} }
grpc_endpoint_add_to_pollset(&exec_ctx, server_endpoint, grpc_cq_pollset(cq));
grpc_server_setup_transport(&exec_ctx, server, transport, NULL, server_args); grpc_server_setup_transport(&exec_ctx, server, transport, NULL, server_args);
grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL); grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL);
grpc_exec_ctx_finish(&exec_ctx); grpc_exec_ctx_finish(&exec_ctx);
...@@ -83,7 +84,7 @@ void grpc_server_add_insecure_channel_from_fd(grpc_server *server, ...@@ -83,7 +84,7 @@ void grpc_server_add_insecure_channel_from_fd(grpc_server *server,
#else // !GPR_SUPPORT_CHANNELS_FROM_FD #else // !GPR_SUPPORT_CHANNELS_FROM_FD
void grpc_server_add_insecure_channel_from_fd(grpc_server *server, void grpc_server_add_insecure_channel_from_fd(grpc_server *server,
grpc_completion_queue *cq, void *cq,
int fd) { int fd) {
GPR_ASSERT(0); GPR_ASSERT(0);
} }
......
...@@ -350,7 +350,7 @@ extern grpc_call_error_to_string_type grpc_call_error_to_string_import; ...@@ -350,7 +350,7 @@ extern grpc_call_error_to_string_type grpc_call_error_to_string_import;
typedef grpc_channel *(*grpc_insecure_channel_create_from_fd_type)(const char *target, int fd, const grpc_channel_args *args); typedef grpc_channel *(*grpc_insecure_channel_create_from_fd_type)(const char *target, int fd, const grpc_channel_args *args);
extern grpc_insecure_channel_create_from_fd_type grpc_insecure_channel_create_from_fd_import; extern grpc_insecure_channel_create_from_fd_type grpc_insecure_channel_create_from_fd_import;
#define grpc_insecure_channel_create_from_fd grpc_insecure_channel_create_from_fd_import #define grpc_insecure_channel_create_from_fd grpc_insecure_channel_create_from_fd_import
typedef void(*grpc_server_add_insecure_channel_from_fd_type)(grpc_server *server, grpc_completion_queue *cq, int fd); typedef void(*grpc_server_add_insecure_channel_from_fd_type)(grpc_server *server, void *reserved, int fd);
extern grpc_server_add_insecure_channel_from_fd_type grpc_server_add_insecure_channel_from_fd_import; extern grpc_server_add_insecure_channel_from_fd_type grpc_server_add_insecure_channel_from_fd_import;
#define grpc_server_add_insecure_channel_from_fd grpc_server_add_insecure_channel_from_fd_import #define grpc_server_add_insecure_channel_from_fd grpc_server_add_insecure_channel_from_fd_import
typedef void(*grpc_use_signal_type)(int signum); typedef void(*grpc_use_signal_type)(int signum);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment