diff options
author | Brad King <brad.king@kitware.com> | 2020-10-14 16:46:55 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-10-14 20:41:50 (GMT) |
commit | 9952ee063a1a2b31c784733b0cf676b4a6efc36e (patch) | |
tree | f019b22a20973bd61f944c002148b8312f64d0bc /Source/cmPipeConnection.cxx | |
parent | c5559597177eabd5620766e9dbc6f02a3b827ddb (diff) | |
download | CMake-9952ee063a1a2b31c784733b0cf676b4a6efc36e.zip CMake-9952ee063a1a2b31c784733b0cf676b4a6efc36e.tar.gz CMake-9952ee063a1a2b31c784733b0cf676b4a6efc36e.tar.bz2 |
server: remove deprecated 'cmake -E server' mode
The server mode has been deprecated since commit 996e1885c4 (server:
deprecate in favor of the file-api, 2019-04-19, v3.15.0-rc1~198^2).
Clients should now be using the file-api. Remove the server mode.
Diffstat (limited to 'Source/cmPipeConnection.cxx')
-rw-r--r-- | Source/cmPipeConnection.cxx | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/Source/cmPipeConnection.cxx b/Source/cmPipeConnection.cxx deleted file mode 100644 index 1eede13..0000000 --- a/Source/cmPipeConnection.cxx +++ /dev/null @@ -1,71 +0,0 @@ -/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying - file Copyright.txt or https://cmake.org/licensing for details. */ -#include "cmPipeConnection.h" - -#include <utility> - -#include "cmServer.h" - -cmPipeConnection::cmPipeConnection(std::string name, - cmConnectionBufferStrategy* bufferStrategy) - : cmEventBasedConnection(bufferStrategy) - , PipeName(std::move(name)) -{ -} - -void cmPipeConnection::Connect(uv_stream_t* server) -{ - if (this->WriteStream.get()) { - // Accept and close all pipes but the first: - cm::uv_pipe_ptr rejectPipe; - - rejectPipe.init(*this->Server->GetLoop(), 0); - uv_accept(server, rejectPipe); - - return; - } - - cm::uv_pipe_ptr ClientPipe; - ClientPipe.init(*this->Server->GetLoop(), 0, - static_cast<cmEventBasedConnection*>(this)); - - if (uv_accept(server, ClientPipe) != 0) { - return; - } - - uv_read_start(ClientPipe, on_alloc_buffer, on_read); - WriteStream = std::move(ClientPipe); - Server->OnConnected(this); -} - -bool cmPipeConnection::OnServeStart(std::string* errorMessage) -{ - this->ServerPipe.init(*this->Server->GetLoop(), 0, - static_cast<cmEventBasedConnection*>(this)); - - int r; - if ((r = uv_pipe_bind(this->ServerPipe, this->PipeName.c_str())) != 0) { - *errorMessage = std::string("Internal Error with ") + this->PipeName + - ": " + uv_err_name(r); - return false; - } - - if ((r = uv_listen(this->ServerPipe, 1, on_new_connection)) != 0) { - *errorMessage = std::string("Internal Error listening on ") + - this->PipeName + ": " + uv_err_name(r); - return false; - } - - return cmConnection::OnServeStart(errorMessage); -} - -bool cmPipeConnection::OnConnectionShuttingDown() -{ - if (this->WriteStream.get()) { - this->WriteStream->data = nullptr; - } - - this->ServerPipe.reset(); - - return cmEventBasedConnection::OnConnectionShuttingDown(); -} |