From: sapier Date: Sun, 4 May 2014 00:43:01 +0000 (+0200) Subject: Fix numeric underflow on calculating window size adjustment X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=09e8bbea03c72cfc21560f953561183b9d29be6a;p=zefram%2Fminetest%2Fminetest_engine.git Fix numeric underflow on calculating window size adjustment --- diff --git a/src/connection.cpp b/src/connection.cpp index e6b76320..341333db 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 90344da3..338ee964 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;