From f5447b96acdb0af0cdfed52f86baea5838792181 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Tue, 5 Sep 2017 08:49:02 +0200 Subject: [PATCH] - nhttpd: remove unused mod_testhook Signed-off-by: Thilo Graf --- src/nhttpd/yconfig.h | 1 - src/nhttpd/yhttpd.cpp | 10 ---------- src/nhttpd/yhttpd_mods/Makefile.am | 6 +++++- src/nhttpd/yhttpd_mods/mod_auth.cpp | 2 +- src/nhttpd/yhttpd_mods/mod_testhook.cpp | 17 ----------------- src/nhttpd/yhttpd_mods/mod_testhook.h | 21 --------------------- 6 files changed, 6 insertions(+), 51 deletions(-) delete mode 100644 src/nhttpd/yhttpd_mods/mod_testhook.cpp delete mode 100644 src/nhttpd/yhttpd_mods/mod_testhook.h diff --git a/src/nhttpd/yconfig.h b/src/nhttpd/yconfig.h index 99b72aeb3..47808a318 100644 --- a/src/nhttpd/yconfig.h +++ b/src/nhttpd/yconfig.h @@ -41,7 +41,6 @@ //----------------------------------------------------------------------------- // modules //----------------------------------------------------------------------------- -//#define Y_CONFIG_USE_TESTHOOK y // Add mod: "Test-Hook" (hook example) #define Y_CONFIG_USE_YPARSER y // Add mod: "y-Parsing" #define Y_CONFIG_USE_AUTHHOOK y // Add mod: "Authentication" #define Y_CONFIG_USE_WEBLOG y // Add mod: "WebLogging" diff --git a/src/nhttpd/yhttpd.cpp b/src/nhttpd/yhttpd.cpp index eb4309360..ef417b8db 100644 --- a/src/nhttpd/yhttpd.cpp +++ b/src/nhttpd/yhttpd.cpp @@ -249,11 +249,6 @@ void Cyhttpd::hooks_attach() { CyhookHandler::attach(auth); #endif -#ifdef Y_CONFIG_USE_TESTHOOK - testhook = new CTesthook(); - CyhookHandler::attach(testhook); -#endif - #ifdef CONFIG_SYSTEM_TUXBOX NeutrinoAPI = new CNeutrinoAPI(); CyhookHandler::attach(NeutrinoAPI->NeutrinoYParser); @@ -287,11 +282,6 @@ void Cyhttpd::hooks_detach() { delete auth; #endif -#ifdef Y_CONFIG_USE_TESTHOOK - CyhookHandler::detach(testhook); - delete testhook; -#endif - #ifdef CONFIG_SYSTEM_TUXBOX CyhookHandler::detach(NeutrinoAPI->NeutrinoYParser); #else diff --git a/src/nhttpd/yhttpd_mods/Makefile.am b/src/nhttpd/yhttpd_mods/Makefile.am index a08445dbd..240d14804 100644 --- a/src/nhttpd/yhttpd_mods/Makefile.am +++ b/src/nhttpd/yhttpd_mods/Makefile.am @@ -16,5 +16,9 @@ AM_CPPFLAGS += -fno-rtti -fno-exceptions -D_FILE_OFFSET_BITS=64 noinst_LIBRARIES = libyhttpdmods.a libyhttpdmods_a_SOURCES = \ - mod_yparser.cpp mod_testhook.cpp mod_auth.cpp mod_cache.cpp mod_sendfile.cpp mod_weblog.cpp + mod_auth.cpp \ + mod_cache.cpp \ + mod_sendfile.cpp \ + mod_weblog.cpp \ + mod_yparser.cpp diff --git a/src/nhttpd/yhttpd_mods/mod_auth.cpp b/src/nhttpd/yhttpd_mods/mod_auth.cpp index 3defe1ca8..50c1f6da5 100644 --- a/src/nhttpd/yhttpd_mods/mod_auth.cpp +++ b/src/nhttpd/yhttpd_mods/mod_auth.cpp @@ -1,6 +1,6 @@ //============================================================================= // YHTTPD -// TestHook +// mod_auth : Authentication //============================================================================= #include diff --git a/src/nhttpd/yhttpd_mods/mod_testhook.cpp b/src/nhttpd/yhttpd_mods/mod_testhook.cpp deleted file mode 100644 index 6f3195203..000000000 --- a/src/nhttpd/yhttpd_mods/mod_testhook.cpp +++ /dev/null @@ -1,17 +0,0 @@ -//============================================================================= -// YHTTPD -// TestHook -//============================================================================= - -#include "mod_testhook.h" - -THandleStatus CTesthook::Hook_SendResponse(CyhookHandler *hh) -{ - THandleStatus status = HANDLED_NONE; - if(hh->UrlData["filename"] == "test2") - { - hh->yresult = "test it 2222\n"; - status = HANDLED_READY; - } - return status; -} diff --git a/src/nhttpd/yhttpd_mods/mod_testhook.h b/src/nhttpd/yhttpd_mods/mod_testhook.h deleted file mode 100644 index 1f6ed9f2e..000000000 --- a/src/nhttpd/yhttpd_mods/mod_testhook.h +++ /dev/null @@ -1,21 +0,0 @@ -//============================================================================= -// YHTTPD -// TestHook -//============================================================================= -#ifndef TESTHOOK_H_ -#define TESTHOOK_H_ - - -#include -class CTesthook : public Cyhook -{ -public: - THandleStatus Hook_SendResponse(CyhookHandler *hh); - CTesthook(){}; - ~CTesthook(){}; - - virtual std::string getHookName(void) {return std::string("Testhook");} - -}; -#endif /*TESTHOOK_H_*/ -