diff --git a/src/compat/compat.h b/src/compat/compat.h index 8195bceaecb..435a4035524 100644 --- a/src/compat/compat.h +++ b/src/compat/compat.h @@ -22,19 +22,18 @@ #include #include #else -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export #endif // We map Linux / BSD error functions and codes, to the equivalent diff --git a/src/torcontrol.cpp b/src/torcontrol.cpp index a8d6fb4b3f0..9cf976a7006 100644 --- a/src/torcontrol.cpp +++ b/src/torcontrol.cpp @@ -14,14 +14,26 @@ #include #include #include +#include +#include +#include +#include #include #include +#include #include #include +#include +#include +#include #include #include +#include +#include #include +#include +#include #include #include @@ -79,15 +91,15 @@ void TorControlConnection::readcb(struct bufferevent *bev, void *ctx) if (s.size() < 4) // Short line continue; // (-|+| ) - self->message.code = LocaleIndependentAtoi(s.substr(0,3)); + self->message.code = ToIntegral(s.substr(0, 3)).value_or(0); self->message.lines.push_back(s.substr(4)); char ch = s[3]; // '-','+' or ' ' if (ch == ' ') { // Final line, dispatch reply and clean up if (self->message.code >= 600) { + // (currently unused) // Dispatch async notifications to async handler // Synchronous and asynchronous messages are never interleaved - self->async_handler(*self, self->message); } else { if (!self->reply_handlers.empty()) { // Invoke reply handler with message diff --git a/src/torcontrol.h b/src/torcontrol.h index afc5413db0d..1a9065b01a9 100644 --- a/src/torcontrol.h +++ b/src/torcontrol.h @@ -11,19 +11,14 @@ #include #include -#include +#include -#include -#include - -#include +#include #include #include #include #include -class CService; - extern const std::string DEFAULT_TOR_CONTROL; static const bool DEFAULT_LISTEN_ONION = true; @@ -83,8 +78,6 @@ public: */ bool Command(const std::string &cmd, const ReplyHandlerCB& reply_handler); - /** Response handlers for async replies */ - boost::signals2::signal async_handler; private: /** Callback when ready for use */ std::function connected;