mirror of https://gitee.com/bigwinds/arangodb
More fuerte changes (#6212)
This commit is contained in:
parent
9d03ab532b
commit
247d41287b
|
@ -57,9 +57,6 @@ class EventLoopService {
|
|||
// Prevent copying
|
||||
EventLoopService(EventLoopService const& other) = delete;
|
||||
EventLoopService& operator=(EventLoopService const& other) = delete;
|
||||
|
||||
/// forcebly stop all io contexts. service is unusable after
|
||||
void forceStop();
|
||||
|
||||
// io_service returns a reference to the boost io_service.
|
||||
std::shared_ptr<asio_io_context>& nextIOContext() {
|
||||
|
|
|
@ -128,10 +128,11 @@ struct Socket<fuerte::SocketType::Ssl> {
|
|||
resolver.async_resolve({config._host, config._port}, rcb);
|
||||
}
|
||||
void shutdown() {
|
||||
if (socket.next_layer().is_open()) {
|
||||
if (socket.lowest_layer().is_open()) {
|
||||
asio_ns::error_code ec;
|
||||
socket.next_layer().shutdown(asio_ns::ip::tcp::socket::shutdown_both, ec);
|
||||
socket.shutdown(ec);
|
||||
socket.lowest_layer().shutdown(asio_ns::ip::tcp::socket::shutdown_both, ec);
|
||||
socket.lowest_layer().close(ec);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -50,22 +50,6 @@ EventLoopService::~EventLoopService() {
|
|||
}
|
||||
}
|
||||
|
||||
/// forcebly stop all io contexts. service is unusable after
|
||||
void EventLoopService::forceStop() {
|
||||
for (auto& guard : _guards) {
|
||||
guard.reset(); // allow run() to exit
|
||||
}
|
||||
for (auto& ctx : _ioContexts) {
|
||||
ctx->stop();
|
||||
}
|
||||
for (std::thread& thread : _threads) {
|
||||
thread.join();
|
||||
}
|
||||
_guards.clear();
|
||||
_threads.clear();
|
||||
_ioContexts.clear();
|
||||
}
|
||||
|
||||
asio_ns::ssl::context& EventLoopService::sslContext() {
|
||||
std::lock_guard<std::mutex> guard(_sslContextMutex);
|
||||
if (!_sslContext) {
|
||||
|
|
|
@ -70,7 +70,6 @@ V8ClientConnection::V8ClientConnection()
|
|||
|
||||
V8ClientConnection::~V8ClientConnection() {
|
||||
shutdownConnection();
|
||||
_loop.forceStop();
|
||||
}
|
||||
|
||||
void V8ClientConnection::createConnection() {
|
||||
|
|
|
@ -73,7 +73,7 @@ int main(int argc, char* argv[]) {
|
|||
server.addFeature(new ShellColorsFeature(server));
|
||||
server.addFeature(new ShellFeature(server, &ret));
|
||||
server.addFeature(new ShutdownFeature(server, {"Shell"}));
|
||||
server.addFeature(new SslFeature(server));
|
||||
//server.addFeature(new SslFeature(server));
|
||||
server.addFeature(new TempFeature(server, name));
|
||||
server.addFeature(new V8PlatformFeature(server));
|
||||
server.addFeature(new V8ShellFeature(server, name));
|
||||
|
|
|
@ -42,7 +42,7 @@ using namespace arangodb::options;
|
|||
|
||||
namespace arangodb {
|
||||
|
||||
const asio::ssl::detail::openssl_init<true> SslFeature::sslBase{};
|
||||
const asio_ns::ssl::detail::openssl_init<true> SslFeature::sslBase{};
|
||||
|
||||
SslFeature::SslFeature(application_features::ApplicationServer& server)
|
||||
: ApplicationFeature(server, "Ssl") {
|
||||
|
|
Loading…
Reference in New Issue