Skip to content

Commit

Permalink
Fix numeric underflow on calculating window size adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
sapier authored and sapier committed May 4, 2014
1 parent cfb2662 commit 09e8bbe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/connection.cpp
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/connection.h
Expand Up @@ -546,7 +546,7 @@ class Channel
void setWindowSize(unsigned int size) { window_size = size; };
private:
JMutex m_internal_mutex;
unsigned int window_size;
int window_size;

u16 next_incoming_seqnum;

Expand Down

0 comments on commit 09e8bbe

Please sign in to comment.