Alex-PLACET commented on code in PR #50407:
URL: https://github.com/apache/arrow/pull/50407#discussion_r3912797933
##########
cpp/src/arrow/flight/transport/grpc/grpc_server.cc:
##########
@@ -583,66 +442,17 @@ class GrpcServerTransport : public
internal::ServerTransport {
new GrpcServiceHandler(options.auth_handler, options.middleware,
this));
::grpc::ServerBuilder builder;
- // Allow uploading messages of any length
- builder.SetMaxReceiveMessageSize(-1);
-
- const std::string scheme = uri.scheme();
int port = 0;
- if (scheme == kSchemeGrpc || scheme == kSchemeGrpcTcp || scheme ==
kSchemeGrpcTls) {
- std::stringstream address;
- address << arrow::util::UriEncodeHost(uri.host()) << ':' <<
uri.port_text();
-
- std::shared_ptr<::grpc::ServerCredentials> creds;
- if (scheme == kSchemeGrpcTls) {
- ::grpc::SslServerCredentialsOptions ssl_options;
- for (const auto& pair : options.tls_certificates) {
- ssl_options.pem_key_cert_pairs.push_back({pair.pem_key,
pair.pem_cert});
- }
- if (options.verify_client) {
- ssl_options.client_certificate_request =
- GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY;
- }
- if (!options.root_certificates.empty()) {
- ssl_options.pem_root_certs = options.root_certificates;
- }
- creds = ::grpc::SslServerCredentials(ssl_options);
- } else {
- creds = ::grpc::InsecureServerCredentials();
- }
-
- builder.AddListeningPort(address.str(), creds, &port);
- } else if (scheme == kSchemeGrpcUnix) {
- std::stringstream address;
- address << "unix:" << uri.path();
- builder.AddListeningPort(address.str(),
::grpc::InsecureServerCredentials());
- location_ = options.location;
- } else {
- return Status::NotImplemented("Scheme is not supported: " + scheme);
- }
Review Comment:
Moved to a dedicated function: AddServerListeningPort
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]