Skip to content

Commit 09e8bbe

Browse files
sapiersapier
sapier
authored and
sapier
committedMay 4, 2014
Fix numeric underflow on calculating window size adjustment
1 parent cfb2662 commit 09e8bbe

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

‎src/connection.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ void Channel::UpdateTimers(float dtime,bool legacy_peer)
716716
packet_too_late = current_packet_too_late;
717717
packets_successfull = current_packet_successfull;
718718

719-
if (current_bytes_transfered > (window_size*512/2))
719+
if (current_bytes_transfered > (unsigned int) (window_size*512/2))
720720
{
721721
reasonable_amount_of_data_transmitted = true;
722722
}

‎src/connection.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ class Channel
546546
void setWindowSize(unsigned int size) { window_size = size; };
547547
private:
548548
JMutex m_internal_mutex;
549-
unsigned int window_size;
549+
int window_size;
550550

551551
u16 next_incoming_seqnum;
552552

0 commit comments

Comments
 (0)
Please sign in to comment.