diff options
author | sfan5 <sfan5@live.de> | 2021-09-11 21:06:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-11 21:06:57 +0200 |
commit | 75bf9b75caba5fc876f20eabea3fabc142d1b51e (patch) | |
tree | c5a584838498760d0cb5e206795ead223d15527b /src/network | |
parent | 766e885a1b1c5afb7a62f11b427b6d135adeab87 (diff) | |
download | minetest-75bf9b75caba5fc876f20eabea3fabc142d1b51e.tar.gz minetest-75bf9b75caba5fc876f20eabea3fabc142d1b51e.tar.bz2 minetest-75bf9b75caba5fc876f20eabea3fabc142d1b51e.zip |
Make sure relevant std::stringstreams are set to binary
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/clientpackethandler.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/network/clientpackethandler.cpp b/src/network/clientpackethandler.cpp index 9c9c59d13..128240c02 100644 --- a/src/network/clientpackethandler.cpp +++ b/src/network/clientpackethandler.cpp @@ -261,7 +261,7 @@ void Client::handleCommand_NodemetaChanged(NetworkPacket *pkt) return; std::istringstream is(pkt->readLongString(), std::ios::binary); - std::stringstream sstr; + std::stringstream sstr(std::ios::binary); decompressZlib(is, sstr); NodeMetadataList meta_updates_list(false); @@ -760,12 +760,11 @@ void Client::handleCommand_NodeDef(NetworkPacket* pkt) // Decompress node definitions std::istringstream tmp_is(pkt->readLongString(), std::ios::binary); - std::ostringstream tmp_os; + std::stringstream tmp_os(std::ios::binary | std::ios::in | std::ios::out); decompressZlib(tmp_is, tmp_os); // Deserialize node definitions - std::istringstream tmp_is2(tmp_os.str()); - m_nodedef->deSerialize(tmp_is2); + m_nodedef->deSerialize(tmp_os); m_nodedef_received = true; } @@ -780,12 +779,11 @@ void Client::handleCommand_ItemDef(NetworkPacket* pkt) // Decompress item definitions std::istringstream tmp_is(pkt->readLongString(), std::ios::binary); - std::ostringstream tmp_os; + std::stringstream tmp_os(std::ios::binary | std::ios::in | std::ios::out); decompressZlib(tmp_is, tmp_os); // Deserialize node definitions - std::istringstream tmp_is2(tmp_os.str()); - m_itemdef->deSerialize(tmp_is2); + m_itemdef->deSerialize(tmp_os); m_itemdef_received = true; } |