diff options
author | sapier <Sapier at GMX dot net> | 2014-05-04 02:43:01 +0200 |
---|---|---|
committer | sapier <Sapier at GMX dot net> | 2014-05-04 02:43:01 +0200 |
commit | 09e8bbea03c72cfc21560f953561183b9d29be6a (patch) | |
tree | a15aedfeab1f813dc5fa5992da7b4b8ff7e3f0e0 | |
parent | cfb26629bffa8732df5f860d493e5cb039c620dd (diff) | |
download | minetest-09e8bbea03c72cfc21560f953561183b9d29be6a.tar.gz minetest-09e8bbea03c72cfc21560f953561183b9d29be6a.tar.bz2 minetest-09e8bbea03c72cfc21560f953561183b9d29be6a.zip |
Fix numeric underflow on calculating window size adjustment
-rw-r--r-- | src/connection.cpp | 2 | ||||
-rw-r--r-- | src/connection.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/connection.cpp b/src/connection.cpp index e6b763206..341333db9 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -716,7 +716,7 @@ void Channel::UpdateTimers(float dtime,bool legacy_peer) packet_too_late = current_packet_too_late; packets_successfull = current_packet_successfull; - if (current_bytes_transfered > (window_size*512/2)) + if (current_bytes_transfered > (unsigned int) (window_size*512/2)) { reasonable_amount_of_data_transmitted = true; } diff --git a/src/connection.h b/src/connection.h index 90344da3e..338ee964c 100644 --- a/src/connection.h +++ b/src/connection.h @@ -546,7 +546,7 @@ public: void setWindowSize(unsigned int size) { window_size = size; }; private: JMutex m_internal_mutex; - unsigned int window_size; + int window_size; u16 next_incoming_seqnum; |