| 174 | } |
| 175 | |
| 176 | bool TorControlConnection::Command(const std::string &cmd, const ReplyHandlerCB& reply_handler) |
| 177 | { |
| 178 | if (!b_conn) |
| 179 | return false; |
| 180 | struct evbuffer *buf = bufferevent_get_output(b_conn); |
| 181 | if (!buf) |
| 182 | return false; |
| 183 | evbuffer_add(buf, cmd.data(), cmd.size()); |
| 184 | evbuffer_add(buf, "\r\n", 2); |
| 185 | reply_handlers.push_back(reply_handler); |
| 186 | return true; |
| 187 | } |
| 188 | |
| 189 | /****** General parsing utilities ********/ |
| 190 |
no test coverage detected