Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

feat(util): add restore_read function in rpc_message #442

Merged
merged 3 commits into from
Apr 24, 2020

Conversation

Smityz
Copy link
Contributor

@Smityz Smityz commented Apr 22, 2020

Previously, when we use unmarshall like this:

  unmarshall(msg, result);
  unmarshall(msg, result);

The code will core dump

F2020-04-24 17:28:29.746 (1587720509746020513 2ac7) client.THREAD_POOL_DEFAULT0.00002ab200010001: rpc_message.cpp:54:set_read_msg(): assertion expression: r
F2020-04-24 17:28:29.746 (1587720509746053734 2ac7) client.THREAD_POOL_DEFAULT0.00002ab200010001: rpc_message.cpp:54:set_read_msg(): read msg must have one segment of buffer ready
Aborted (core dumped)

and now we can

  unmarshall(msg, result);
  msg->restore_read();
  unmarshall(msg, result);

to avoid this problem.

@Smityz Smityz changed the title feat(hotkey): add restore function in rpc_message feat(hotkey): add restore_read function in rpc_message Apr 24, 2020
@Smityz Smityz requested a review from neverchanje April 24, 2020 09:35
src/core/core/rpc_message.cpp Outdated Show resolved Hide resolved
src/core/tests/rpc_message.cpp Outdated Show resolved Hide resolved
@neverchanje neverchanje changed the title feat(hotkey): add restore_read function in rpc_message feat(util): add restore_read function in rpc_message Apr 24, 2020
@acelyc111 acelyc111 merged commit d790be2 into XiaoMi:master Apr 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants