Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make grpc_tcp_listener private. #4680

Merged
merged 14 commits into from
Jan 25, 2016
Prev Previous commit
Next Next commit
clang reformat.
  • Loading branch information
daniel-j-born committed Jan 14, 2016
commit a78ca38e108610672b38cf0ecb0507d167ee25ce
5 changes: 3 additions & 2 deletions src/core/iomgr/tcp_server_windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,9 @@ static void on_accept(grpc_exec_ctx *exec_ctx, void *arg, int from_iocp) {

/* The only time we should call our callback, is where we successfully
managed to accept a connection, and created an endpoint. */
if (ep) sp->server->on_accept_cb(exec_ctx, sp->server->on_accept_cb_arg, ep,
&acceptor);
if (ep)
sp->server->on_accept_cb(exec_ctx, sp->server->on_accept_cb_arg, ep,
&acceptor);
/* As we were notified from the IOCP of one and exactly one accept,
the former socked we created has now either been destroy or assigned
to the new connection. We need to create a new one for the next
Expand Down
8 changes: 4 additions & 4 deletions test/core/iomgr/tcp_server_posix_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ static void test_connect(unsigned n) {
tcp_connect(&exec_ctx, (struct sockaddr *)&addr, addr_len, &result);
GPR_ASSERT(result.server_fd >= 0);
svr_fd = result.server_fd;
GPR_ASSERT(grpc_tcp_server_port_fd(s, result.port_index, result.fd_index)
== result.server_fd);
GPR_ASSERT(grpc_tcp_server_port_fd(s, result.port_index, result.fd_index) ==
result.server_fd);
GPR_ASSERT(result.port_index == 0);
GPR_ASSERT(result.fd_index < svr_fd_count);

Expand All @@ -248,8 +248,8 @@ static void test_connect(unsigned n) {
tcp_connect(&exec_ctx, (struct sockaddr *)&addr1, addr_len, &result);
GPR_ASSERT(result.server_fd >= 0);
GPR_ASSERT(result.server_fd != svr_fd);
GPR_ASSERT(grpc_tcp_server_port_fd(s, result.port_index, result.fd_index)
== result.server_fd);
GPR_ASSERT(grpc_tcp_server_port_fd(s, result.port_index, result.fd_index) ==
result.server_fd);
GPR_ASSERT(result.port_index == 1);
GPR_ASSERT(result.fd_index < svr_fd_count);
}
Expand Down