File tree Expand file tree Collapse file tree 3 files changed +28
-24
lines changed Expand file tree Collapse file tree 3 files changed +28
-24
lines changed Original file line number Diff line number Diff line change 2222#include < ws2tcpip.h>
2323#include < cstdint>
2424#else
25- #include < fcntl.h>
26- #include < sys/mman.h>
27- #include < sys/select.h>
28- #include < sys/socket.h>
29- #include < sys/types.h>
30- #include < net/if.h>
31- #include < netinet/in.h>
32- #include < netinet/tcp.h>
33- #include < arpa/inet.h>
34- #include < ifaddrs.h>
35- #include < limits.h>
36- #include < netdb.h>
37- #include < unistd.h>
25+ #include < arpa/inet.h> // IWYU pragma: export
26+ #include < fcntl.h> // IWYU pragma: export
27+ #include < ifaddrs.h> // IWYU pragma: export
28+ #include < net/if.h> // IWYU pragma: export
29+ #include < netdb.h> // IWYU pragma: export
30+ #include < netinet/in.h> // IWYU pragma: export
31+ #include < netinet/tcp.h> // IWYU pragma: export
32+ #include < sys/mman.h> // IWYU pragma: export
33+ #include < sys/select.h> // IWYU pragma: export
34+ #include < sys/socket.h> // IWYU pragma: export
35+ #include < sys/types.h> // IWYU pragma: export
36+ #include < unistd.h> // IWYU pragma: export
3837#endif
3938
4039// We map Linux / BSD error functions and codes, to the equivalent
Original file line number Diff line number Diff line change 1414#include < net.h>
1515#include < netaddress.h>
1616#include < netbase.h>
17+ #include < random.h>
18+ #include < tinyformat.h>
19+ #include < util/check.h>
20+ #include < util/fs.h>
1721#include < util/readwritefile.h>
1822#include < util/strencodings.h>
23+ #include < util/string.h>
1924#include < util/thread.h>
2025#include < util/time.h>
2126
27+ #include < algorithm>
28+ #include < cassert>
29+ #include < cstdlib>
2230#include < deque>
2331#include < functional>
32+ #include < map>
33+ #include < optional>
2434#include < set>
35+ #include < thread>
36+ #include < utility>
2537#include < vector>
2638
2739#include < event2/buffer.h>
@@ -79,15 +91,15 @@ void TorControlConnection::readcb(struct bufferevent *bev, void *ctx)
7991 if (s.size () < 4 ) // Short line
8092 continue ;
8193 // <status>(-|+| )<data><CRLF>
82- self->message .code = LocaleIndependentAtoi <int >(s.substr (0 ,3 ) );
94+ self->message .code = ToIntegral <int >(s.substr (0 , 3 )). value_or ( 0 );
8395 self->message .lines .push_back (s.substr (4 ));
8496 char ch = s[3 ]; // '-','+' or ' '
8597 if (ch == ' ' ) {
8698 // Final line, dispatch reply and clean up
8799 if (self->message .code >= 600 ) {
100+ // (currently unused)
88101 // Dispatch async notifications to async handler
89102 // Synchronous and asynchronous messages are never interleaved
90- self->async_handler (*self, self->message );
91103 } else {
92104 if (!self->reply_handlers .empty ()) {
93105 // Invoke reply handler with message
Original file line number Diff line number Diff line change 1111#include < netaddress.h>
1212#include < util/fs.h>
1313
14- #include < boost/signals2/signal.hpp >
14+ #include < event2/util.h >
1515
16- #include < event2/bufferevent.h>
17- #include < event2/event.h>
18-
19- #include < cstdlib>
16+ #include < cstdint>
2017#include < deque>
2118#include < functional>
2219#include < string>
2320#include < vector>
2421
25- class CService ;
26-
2722extern const std::string DEFAULT_TOR_CONTROL;
2823static const bool DEFAULT_LISTEN_ONION = true ;
2924
@@ -83,8 +78,6 @@ class TorControlConnection
8378 */
8479 bool Command (const std::string &cmd, const ReplyHandlerCB& reply_handler);
8580
86- /* * Response handlers for async replies */
87- boost::signals2::signal<void (TorControlConnection &,const TorControlReply &)> async_handler;
8881private:
8982 /* * Callback when ready for use */
9083 std::function<void (TorControlConnection&)> connected;
You can’t perform that action at this time.
0 commit comments