From 4d44c3f37eba27b984d599eccb047614579e8b39 Mon Sep 17 00:00:00 2001 From: Arne Juul Date: Wed, 13 Mar 2019 11:30:45 +0000 Subject: remove old code --- configd/src/apps/sentinel/CMakeLists.txt | 1 - configd/src/apps/sentinel/command-connection.cpp | 61 ------------------------ configd/src/apps/sentinel/command-connection.h | 28 ----------- configd/src/apps/sentinel/config-handler.cpp | 1 - 4 files changed, 91 deletions(-) delete mode 100644 configd/src/apps/sentinel/command-connection.cpp delete mode 100644 configd/src/apps/sentinel/command-connection.h 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 -#include -#include -#include -#include - -#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 -- cgit v1.2.3