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 22
22
#include < ws2tcpip.h>
23
23
#include < cstdint>
24
24
#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
38
37
#endif
39
38
40
39
// We map Linux / BSD error functions and codes, to the equivalent
Original file line number Diff line number Diff line change 14
14
#include < net.h>
15
15
#include < netaddress.h>
16
16
#include < netbase.h>
17
+ #include < random.h>
18
+ #include < tinyformat.h>
19
+ #include < util/check.h>
20
+ #include < util/fs.h>
17
21
#include < util/readwritefile.h>
18
22
#include < util/strencodings.h>
23
+ #include < util/string.h>
19
24
#include < util/thread.h>
20
25
#include < util/time.h>
21
26
27
+ #include < algorithm>
28
+ #include < cassert>
29
+ #include < cstdlib>
22
30
#include < deque>
23
31
#include < functional>
32
+ #include < map>
33
+ #include < optional>
24
34
#include < set>
35
+ #include < thread>
36
+ #include < utility>
25
37
#include < vector>
26
38
27
39
#include < event2/buffer.h>
@@ -79,15 +91,15 @@ void TorControlConnection::readcb(struct bufferevent *bev, void *ctx)
79
91
if (s.size () < 4 ) // Short line
80
92
continue ;
81
93
// <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 );
83
95
self->message .lines .push_back (s.substr (4 ));
84
96
char ch = s[3 ]; // '-','+' or ' '
85
97
if (ch == ' ' ) {
86
98
// Final line, dispatch reply and clean up
87
99
if (self->message .code >= 600 ) {
100
+ // (currently unused)
88
101
// Dispatch async notifications to async handler
89
102
// Synchronous and asynchronous messages are never interleaved
90
- self->async_handler (*self, self->message );
91
103
} else {
92
104
if (!self->reply_handlers .empty ()) {
93
105
// Invoke reply handler with message
Original file line number Diff line number Diff line change 11
11
#include < netaddress.h>
12
12
#include < util/fs.h>
13
13
14
- #include < boost/signals2/signal.hpp >
14
+ #include < event2/util.h >
15
15
16
- #include < event2/bufferevent.h>
17
- #include < event2/event.h>
18
-
19
- #include < cstdlib>
16
+ #include < cstdint>
20
17
#include < deque>
21
18
#include < functional>
22
19
#include < string>
23
20
#include < vector>
24
21
25
- class CService ;
26
-
27
22
extern const std::string DEFAULT_TOR_CONTROL;
28
23
static const bool DEFAULT_LISTEN_ONION = true ;
29
24
@@ -83,8 +78,6 @@ class TorControlConnection
83
78
*/
84
79
bool Command (const std::string &cmd, const ReplyHandlerCB& reply_handler);
85
80
86
- /* * Response handlers for async replies */
87
- boost::signals2::signal<void (TorControlConnection &,const TorControlReply &)> async_handler;
88
81
private:
89
82
/* * Callback when ready for use */
90
83
std::function<void (TorControlConnection&)> connected;
You can’t perform that action at this time.
0 commit comments