diff --git a/server/json/jsonRequestId.h b/server/json/jsonRequestId.h index 95e6aa91..c334dc92 100644 --- a/server/json/jsonRequestId.h +++ b/server/json/jsonRequestId.h @@ -36,11 +36,19 @@ struct req_id integer }; - req_id() : type(value_t::null) + req_id() : type(value_t::null), int_id(0), string_id("") { } - req_id(Json json_id) : type(value_t::null) + req_id(int id) : type(value_t::integer), int_id(id), string_id("") + { + } + + req_id(const std::string& id) : type(value_t::string), int_id(0), string_id(id) + { + } + + explicit req_id(Json json_id) : type(value_t::null) { if (json_id.is_null()) { @@ -77,8 +85,8 @@ struct req_id } value_t type; - std::string string_id; int int_id; + std::string string_id; }; diff --git a/server/json/jsonrpc.cpp b/server/json/jsonrpc.cpp index 76bf59f2..b21e2d41 100644 --- a/server/json/jsonrpc.cpp +++ b/server/json/jsonrpc.cpp @@ -24,7 +24,7 @@ using namespace std; -JsonRequest::JsonRequest() : id(-1), method("") +JsonRequest::JsonRequest() : id(), method("") { }