diff options
author | Arne Juul <arnej@yahoo-inc.com> | 2019-03-13 11:30:45 +0000 |
---|---|---|
committer | Arne Juul <arnej@yahoo-inc.com> | 2019-03-13 11:30:45 +0000 |
commit | 4d44c3f37eba27b984d599eccb047614579e8b39 (patch) | |
tree | 262284112b8d1403a85cd371d4f567b289d75160 /configd | |
parent | 6ff41ca29c8fb36e7a59f0649f746051e1310a6f (diff) |
remove old code
Diffstat (limited to 'configd')
-rw-r--r-- | configd/src/apps/sentinel/CMakeLists.txt | 1 | ||||
-rw-r--r-- | configd/src/apps/sentinel/command-connection.cpp | 61 | ||||
-rw-r--r-- | configd/src/apps/sentinel/command-connection.h | 28 | ||||
-rw-r--r-- | configd/src/apps/sentinel/config-handler.cpp | 1 |
4 files changed, 0 insertions, 91 deletions
diff --git a/configd/src/apps/sentinel/CMakeLists.txt b/configd/src/apps/sentinel/CMakeLists.txt index 6d41d674346..b4fca4a3285 100644 --- a/configd/src/apps/sentinel/CMakeLists.txt +++ b/configd/src/apps/sentinel/CMakeLists.txt @@ -5,7 +5,6 @@ vespa_add_executable(configd_config-sentinel_app service.cpp config-handler.cpp line-splitter.cpp - command-connection.cpp output-connection.cpp metrics.cpp state-api.cpp diff --git a/configd/src/apps/sentinel/command-connection.cpp b/configd/src/apps/sentinel/command-connection.cpp deleted file mode 100644 index f253e084305..00000000000 --- a/configd/src/apps/sentinel/command-connection.cpp +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <unistd.h> -#include <stdarg.h> -#include <cstdio> -#include <cstring> -#include <sys/socket.h> - -#include "command-connection.h" -#include "line-splitter.h" - -namespace config { -namespace sentinel { - -CommandConnection::CommandConnection(int f) - : _fd(f), - _lines(f) -{ -} - -bool -CommandConnection::isFinished() const -{ - return _lines.eof(); -} - -char * -CommandConnection::getCommand() -{ - return _lines.getLine(); -} - -CommandConnection::~CommandConnection() -{ - close(_fd); -} - -void -CommandConnection::finish() -{ - ::shutdown(_fd, SHUT_RDWR); -} - -int -CommandConnection::printf(const char *fmt, ...) -{ - char buf[10000]; - va_list args; - va_start(args, fmt); - - int ret = vsnprintf(buf, sizeof buf, fmt, args); - va_end(args); - - ssize_t len = strlen(buf); - if (write(_fd, buf, len) != len) { - perror("CommandConnection::printf failed"); - } - return ret; -} - -} // end namespace config::sentinel -} // end namespace config diff --git a/configd/src/apps/sentinel/command-connection.h b/configd/src/apps/sentinel/command-connection.h deleted file mode 100644 index b637a519384..00000000000 --- a/configd/src/apps/sentinel/command-connection.h +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#pragma once - -#include "line-splitter.h" - -namespace config::sentinel { - -class CommandConnection { -private: - int _fd; - LineSplitter _lines; - - // Unused constructors/assignment operator: - CommandConnection(); - CommandConnection(const CommandConnection&); - CommandConnection& operator =(const CommandConnection&); - -public: - explicit CommandConnection(int fd); - ~CommandConnection(); - bool isFinished() const; - char *getCommand(); - int printf(const char *fmt, ...) __attribute__((format(printf, 2, 3))); - void finish(); - int fd() const { return _fd; } -}; - -} diff --git a/configd/src/apps/sentinel/config-handler.cpp b/configd/src/apps/sentinel/config-handler.cpp index a2ac35edd7f..a434835c656 100644 --- a/configd/src/apps/sentinel/config-handler.cpp +++ b/configd/src/apps/sentinel/config-handler.cpp @@ -1,7 +1,6 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "config-handler.h" -#include "command-connection.h" #include "output-connection.h" #include <vespa/vespalib/net/simple_metric_snapshot.h> |