diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-02-24 18:02:49 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-02-24 18:02:49 +0100 |
| commit | de795b3e103309210dac9e331d45aacf0f0d884c (patch) | |
| tree | cb1679edba6f292665bfa10f673f2aed6efb4986 /src/lib/encode_server.cc | |
| parent | c003df64136806705d7662a885ada028a2ba3032 (diff) | |
Fix config.xml corruption when it contains multi-byte UTF8 characters.
Diffstat (limited to 'src/lib/encode_server.cc')
| -rw-r--r-- | src/lib/encode_server.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/encode_server.cc b/src/lib/encode_server.cc index 92589c573..891b8caac 100644 --- a/src/lib/encode_server.cc +++ b/src/lib/encode_server.cc @@ -295,8 +295,8 @@ EncodeServer::broadcast_received () try { auto socket = make_shared<Socket>(); socket->connect (boost::asio::ip::tcp::endpoint (_broadcast.send_endpoint.address(), MAIN_SERVER_PRESENCE_PORT)); - socket->write (xml.length() + 1); - socket->write ((uint8_t *) xml.c_str(), xml.length() + 1); + socket->write (xml.bytes() + 1); + socket->write ((uint8_t *) xml.c_str(), xml.bytes() + 1); } catch (...) { } @@ -304,8 +304,8 @@ EncodeServer::broadcast_received () try { auto socket = make_shared<Socket>(); socket->connect (boost::asio::ip::tcp::endpoint (_broadcast.send_endpoint.address(), BATCH_SERVER_PRESENCE_PORT)); - socket->write (xml.length() + 1); - socket->write ((uint8_t *) xml.c_str(), xml.length() + 1); + socket->write (xml.bytes() + 1); + socket->write ((uint8_t *) xml.c_str(), xml.bytes() + 1); } catch (...) { } |
