X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FConsole%2FServer.cc;h=cbc8acabd724954d1caf5173a809505f639e0cfd;hb=7ff3c55db7420433cea0bd7f0fe6c82583f78d4f;hp=04b54be8427a4216ebb98010917b20487b9a5a41;hpb=958bdb52c39fa39f4ef91cafd9628bcb4f85a03c;p=senf.git diff --git a/Utils/Console/Server.cc b/Utils/Console/Server.cc index 04b54be..cbc8aca 100644 --- a/Utils/Console/Server.cc +++ b/Utils/Console/Server.cc @@ -27,6 +27,7 @@ #include "Server.ih" // Custom includes +#include #include #include #include @@ -35,7 +36,7 @@ #include "../../Utils/senfassert.hh" #include "../../Utils/membind.hh" #include "../../Utils/Logger/SenfLog.hh" -#include "Readline.hh" +#include "LineEditor.hh" //#include "Server.mpp" #define prefix_ @@ -50,8 +51,7 @@ prefix_ std::streamsize senf::console::detail::NonblockingSocketSink::write(cons try { if (client_.handle().writeable()) { std::string data (s, n); - client_.translate(data); - client_.handle().write( data ); + client_.write(data); } } catch (SystemException & ex) { @@ -94,7 +94,8 @@ prefix_ senf::console::Server::Server(ServerHandle handle) : handle_ (handle), event_ ("senf::console::Server", senf::membind(&Server::newClient, this), handle_, scheduler::FdEvent::EV_READ), - root_ (senf::console::root().thisptr()), mode_ (Automatic) + root_ (senf::console::root().thisptr()), mode_ (Automatic), + name_ (::program_invocation_short_name) {} prefix_ void senf::console::Server::newClient(int event) @@ -149,6 +150,7 @@ senf::console::detail::DumbClientReader::clientData(senf::ReadHelpertranslate(data); -} - prefix_ std::string::size_type senf::console::Client::handleInput(std::string data, bool incremental) { @@ -292,7 +293,11 @@ prefix_ std::string::size_type senf::console::Client::handleInput(std::string da handle_.facet().shutdown(senf::TCPSocketProtocol::ShutRD); } catch (std::exception & ex) { - stream() << ex.what() << std::endl; + std::string msg (ex.what()); + std::string::size_type i (msg.find("-- \n")); + if (i != std::string::npos) + msg = msg.substr(i+4); + stream() << msg << std::endl; } catch (...) { stream() << "unidentified error (unknown exception thrown)" << std::endl;