From a9fa9abad386ed25780d8e780cf91b0a1f22f0d4 Mon Sep 17 00:00:00 2001 From: stephb9959 Date: Wed, 20 Apr 2022 08:17:03 -0700 Subject: [PATCH] Improving RTTYS --- rtty_ui/index.html | 27 ++++++++++++++++++++++++++- src/rttys/RTTYS_WebServer.cpp | 2 +- src/rttys/RTTYS_device.cpp | 14 +------------- 3 files changed, 28 insertions(+), 15 deletions(-) diff --git a/rtty_ui/index.html b/rtty_ui/index.html index 0d7370a6..3fb3f645 100644 --- a/rtty_ui/index.html +++ b/rtty_ui/index.html @@ -1 +1,26 @@ -Rttys
\ No newline at end of file + + + + + + + + RTTYs + + + + + + + + + +
+ + + \ No newline at end of file diff --git a/src/rttys/RTTYS_WebServer.cpp b/src/rttys/RTTYS_WebServer.cpp index 5e750b89..ce44372b 100644 --- a/src/rttys/RTTYS_WebServer.cpp +++ b/src/rttys/RTTYS_WebServer.cpp @@ -130,7 +130,7 @@ namespace OpenWifi { Path = RTTYS_server()->UIAssets() + Path; } - std::cout << id << ": service path '" << Path << "'" << std::endl; + std::cout << id << ": Serving path '" << Path << "'" << std::endl; // simple test to block .. or ~ in path names. if(Path.find("../")!=std::string::npos) { diff --git a/src/rttys/RTTYS_device.cpp b/src/rttys/RTTYS_device.cpp index becafad8..3c8527d2 100644 --- a/src/rttys/RTTYS_device.cpp +++ b/src/rttys/RTTYS_device.cpp @@ -35,9 +35,9 @@ namespace OpenWifi { RTTY_Device_ConnectionHandler::~RTTY_Device_ConnectionHandler() { + socket_.close(); reactor_.removeEventHandler(socket_, Poco::NObserver(*this, &RTTY_Device_ConnectionHandler::onSocketReadable)); reactor_.removeEventHandler(socket_, Poco::NObserver(*this, &RTTY_Device_ConnectionHandler::onSocketShutdown)); - socket_.close(); if(!id_.empty()) { std::cout << conn_id_ << ": Device de-registering during connection" << std::endl; RTTYS_server()->DeRegister(id_, this); @@ -47,18 +47,6 @@ namespace OpenWifi { } } - std::string RTTY_Device_ConnectionHandler::SafeCopy( const u_char * buf, int MaxSize, int & NewPos) { - std::string S; - while(NewPos