Skip to content

Commit

Permalink
InspectorServer: Use the 32-bit data length when sending a request
Browse files Browse the repository at this point in the history
`length` was inheriting `size_t` type of the `String::length()`, while
everywhere else in the Inspector we expect fixed 32-bit field. On the
architectures where `sizeof(size_t) != sizeof(u32)` this broke the
Inspector communication completely.
  • Loading branch information
speles authored and awesomekling committed Jan 8, 2022
1 parent 1b8012e commit 46f6c86
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Userland/Services/InspectorServer/InspectableProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ String InspectableProcess::wait_for_response()
void InspectableProcess::send_request(JsonObject const& request)
{
auto serialized = request.to_string();
auto length = serialized.length();
u32 length = serialized.length();
m_socket->write((u8 const*)&length, sizeof(length));
m_socket->write(serialized);
}
Expand Down

0 comments on commit 46f6c86

Please sign in to comment.