Skip to content

Commit ff8d4df

Browse files
committed
impr: server did not default initialize its dispatcher.
impr: server.run is bool
1 parent e179e64 commit ff8d4df

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/server.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,19 @@ class RPCServer {
3232
return dispatcher.bind(name, func, tag);
3333
}
3434

35-
bool hasTag(MsgPack::str_t name, MsgPack::str_t tag) const {
35+
bool hasTag(const MsgPack::str_t& name, MsgPack::str_t tag) const {
3636
return dispatcher.hasTag(name, tag);
3737
}
3838

39-
void run() {
39+
bool run() {
4040

4141
RPCRequest<> req;
4242

43-
if (!get_rpc(req)) return; // Populate local request
43+
if (!get_rpc(req)) return false; // Populate local request
4444

4545
process_request(req); // Process local data
4646

47-
send_response(req); // Send local data
47+
return send_response(req); // Send local data
4848

4949
}
5050

@@ -87,7 +87,7 @@ class RPCServer {
8787

8888
private:
8989
RpcDecoder<>* decoder = nullptr;
90-
RpcFunctionDispatcher<MAX_CALLBACKS> dispatcher;
90+
RpcFunctionDispatcher<MAX_CALLBACKS> dispatcher{};
9191

9292
};
9393

0 commit comments

Comments
 (0)