#include "common/ceph_argparse.h"
#include "common/debug.h"
+#include "common/WorkQueue.h"
#include "global/global_init.h"
#include "msg/Messenger.h"
#include "messages/MOSDOp.h"
}
void _process_finish(Message *m) override { }
void _clear() override {
- assert(messages.empty());
+ ceph_assert(messages.empty());
}
} op_wq;
//cerr << __func__ << " reply message=" << m << std::endl;
op_wq.queue(m);
}
- bool ms_verify_authorizer(Connection *con, int peer_type, int protocol,
- bufferlist& authorizer, bufferlist& authorizer_reply,
- bool& isvalid, CryptoKey& session_key,
- std::unique_ptr<AuthAuthorizerChallenge> *challenge) override {
- isvalid = true;
- return true;
+ int ms_handle_authentication(Connection *con) override {
+ return 1;
}
};
ServerDispatcher dispatcher;
public:
- MessengerServer(string t, string addr, int threads, int delay):
+ MessengerServer(const string &t, const string &addr, int threads, int delay):
msgr(NULL), type(t), bindaddr(addr), dispatcher(threads, delay) {
msgr = Messenger::create(g_ceph_context, type, entity_name_t::OSD(0), "server", 0, 0);
msgr->set_default_policy(Messenger::Policy::stateless_server(0));
argv_to_vec(argc, (const char **)argv, args);
auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT,
- CODE_ENVIRONMENT_UTILITY, 0);
+ CODE_ENVIRONMENT_UTILITY,
+ CINIT_FLAG_NO_DEFAULT_CONFIG_FILE);
common_init_finish(g_ceph_context);
- g_ceph_context->_conf->apply_changes(NULL);
+ g_ceph_context->_conf.apply_changes(nullptr);
if (args.size() < 3) {
usage(argv[0]);
int worker_threads = atoi(args[1]);
int think_time = atoi(args[2]);
- std::string public_msgr_type = g_ceph_context->_conf->ms_public_type.empty() ? g_ceph_context->_conf->get_val<std::string>("ms_type") : g_ceph_context->_conf->ms_public_type;
+ std::string public_msgr_type = g_ceph_context->_conf->ms_public_type.empty() ? g_ceph_context->_conf.get_val<std::string>("ms_type") : g_ceph_context->_conf->ms_public_type;
cerr << " This tool won't handle connection error alike things, " << std::endl;
cerr << "please ensure the proper network environment to test." << std::endl;