Skip to content

Commit

Permalink
[XrdCl] Fix: xcp throws FP exception when calc transfer rate.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmichal committed May 10, 2017
1 parent f310944 commit 194d04a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/XrdCl/XrdClXCpSrc.cc
Expand Up @@ -536,7 +536,8 @@ XRootDStatus XCpSrc::GetWork()

uint64_t XCpSrc::TransferRate()
{
return pDataTransfered / ( pTransferTime + time( 0 ) - pStartTime );
time_t duration = pTransferTime + time( 0 ) - pStartTime;
return pDataTransfered / ( duration + 1 ); // add one to avoid floating point exception
}

} /* namespace XrdCl */

0 comments on commit 194d04a

Please sign in to comment.