1
1

added patch to address underflow when -n is not a multiple of -l

from Nathan Jones: https://sourceforge.net/tracker/index.php?func=detail&aid=1943432&group_id=128336&atid=711373
Этот коммит содержится в:
Jon Dugan 2008-05-10 02:26:48 +00:00
родитель 7566010019
Коммит 0c9092408e
3 изменённых файлов: 21 добавлений и 2 удалений

Просмотреть файл

@ -28,3 +28,6 @@ Andrew Gallatin <gallatin@gmail.com>
Stephen Hemminger <shemminger@linux-foundation.org>
* Linux congestion control selection and theading improvements
Nathan Jones <nmjones@users.sourceforge.net>
* patch for underflow when value specified in -n is not a multiple of -l

Просмотреть файл

@ -1,3 +1,9 @@
2008-05-09 Nathan Jones <nmjones@users.sourceforge.net>
* prevent underflow when the amount of data to be transmitted (-n) is not a
multiple of the buffer size (-l) Patch:
https://sourceforge.net/tracker/index.php?func=detail&aid=1943432&group_id=128336&atid=711373
2008-04-08 Jon Dugan <jdugan@x1024.net>
* print report headers only once

Просмотреть файл

@ -170,7 +170,12 @@ void Client::RunTCP( void ) {
}
if ( !mMode_Time ) {
mSettings->mAmount -= currLen;
/* mAmount may be unsigned, so don't let it underflow! */
if( mSettings->mAmount >= currLen ) {
mSettings->mAmount -= currLen;
} else {
mSettings->mAmount = 0;
}
}
} while ( ! (sInterupted ||
@ -310,7 +315,12 @@ void Client::Run( void ) {
delay_loop( delay );
}
if ( !mMode_Time ) {
mSettings->mAmount -= currLen;
/* mAmount may be unsigned, so don't let it underflow! */
if( mSettings->mAmount >= currLen ) {
mSettings->mAmount -= currLen;
} else {
mSettings->mAmount = 0;
}
}
} while ( ! (sInterupted ||