InspectorServer: Use the 32-bit data length when sending a request

`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.
This commit is contained in:
Sviatoslav Peleshko 2022-01-08 21:30:09 +02:00 committed by Andreas Kling
parent 1b8012e5c7
commit 46f6c86362

View file

@ -73,7 +73,7 @@ String InspectableProcess::wait_for_response()
void InspectableProcess::send_request(JsonObject const& request) void InspectableProcess::send_request(JsonObject const& request)
{ {
auto serialized = request.to_string(); auto serialized = request.to_string();
auto length = serialized.length(); u32 length = serialized.length();
m_socket->write((u8 const*)&length, sizeof(length)); m_socket->write((u8 const*)&length, sizeof(length));
m_socket->write(serialized); m_socket->write(serialized);
} }