mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-17 13:13:36 +00:00
Fix
This commit is contained in:
parent
d8fb1cb0e0
commit
3a393042a2
@ -46,7 +46,7 @@ StorageMongoDB::StorageMongoDB(
|
||||
, username(username_)
|
||||
, password(password_)
|
||||
, options(options_)
|
||||
, uri("mongodb://" + username_ + ":" + password_ + "@" + host_ + ":" + std::to_string(port_) + "/" + database_name_ + "?" + options_)
|
||||
, uri("mongodb://" + host_ + ":" + std::to_string(port_) + "/" + database_name_ + "?" + options_)
|
||||
{
|
||||
StorageInMemoryMetadata storage_metadata;
|
||||
storage_metadata.setColumns(columns_);
|
||||
|
@ -17,11 +17,7 @@ namespace DB
|
||||
|
||||
Poco::Net::StreamSocket StorageMongoDBSocketFactory::createSocket(const std::string & host, int port, Poco::Timespan connectTimeout, bool secure)
|
||||
{
|
||||
#if USE_SSL
|
||||
return secure ? createSecureSocket(host, port, connectTimeout) : createPlainSocket(host, port, connectTimeout);
|
||||
#else
|
||||
return createPlainSocket(host, port, connectTimeout);
|
||||
#endif
|
||||
}
|
||||
|
||||
Poco::Net::StreamSocket StorageMongoDBSocketFactory::createPlainSocket(const std::string & host, int port, Poco::Timespan connectTimeout)
|
||||
@ -34,16 +30,19 @@ Poco::Net::StreamSocket StorageMongoDBSocketFactory::createPlainSocket(const std
|
||||
return socket;
|
||||
}
|
||||
|
||||
#if USE_SSL
|
||||
|
||||
Poco::Net::StreamSocket StorageMongoDBSocketFactory::createSecureSocket(const std::string & host, int port, Poco::Timespan connectTimeout)
|
||||
{
|
||||
#if USE_SSL
|
||||
Poco::Net::SocketAddress address(host, port);
|
||||
Poco::Net::SecureStreamSocket socket;
|
||||
|
||||
socket.connect(address, connectTimeout);
|
||||
|
||||
return socket;
|
||||
}
|
||||
#else
|
||||
return createPlainSocket(host, port, connectTimeout);
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user