| 231 | } |
| 232 | |
| 233 | bool TorControlConnection::Command(const std::string &cmd, const ReplyHandlerCB& reply_handler) |
| 234 | { |
| 235 | if (!b_conn) |
| 236 | return false; |
| 237 | struct evbuffer *buf = bufferevent_get_output(b_conn); |
| 238 | if (!buf) |
| 239 | return false; |
| 240 | evbuffer_add(buf, cmd.data(), cmd.size()); |
| 241 | evbuffer_add(buf, "\r\n", 2); |
| 242 | reply_handlers.push_back(reply_handler); |
| 243 | return true; |
| 244 | } |
| 245 | |
| 246 | /****** General parsing utilities ********/ |
| 247 |
no test coverage detected