Bug 811120 - negative download times in stub installer pings. r=rstrong

This commit is contained in:
Brian R. Bondy 2012-11-13 16:03:49 -05:00
parent a62084789a
commit dfb3ca7731
2 changed files with 8 additions and 9 deletions

View File

@ -35,7 +35,7 @@
!define BETA_UPDATE_CHANNEL
!endif
!define BaseURLStubPing "http://download-stats.mozilla.org/stub/v1/"
!define BaseURLStubPing "http://download-stats.mozilla.org/stub/v2/"
# NO_INSTDIR_FROM_REG is defined for pre-releases which have a PreReleaseSuffix
# (e.g. Alpha X, Beta X, etc.) to prevent finding a non-default installation

View File

@ -68,6 +68,7 @@ Var TmpVal
Var InstallCounterStep
Var ExitCode
Var DownloadStartTime
Var SecondsToDownload
Var ExistingProfile
Var ExistingInstall
@ -892,7 +893,7 @@ Function createInstall
System::Int64Op $1 * 0x100000000
Pop $1
System::Int64Op $1 + $0
Pop $SecondsToDownload
Pop $DownloadStartTime
${NSD_CreateTimer} StartDownload ${DownloadIntervalMS}
@ -910,10 +911,8 @@ Function leaveInstall
# Need a ping?
FunctionEnd
; This function is not idempotent. It calculates the amount of time between now
; and $SecondsToDownload and stores the results back into $SecondsToDownload.
; For that reason it should only be called once for the purpose of determining
; the number of elapsed seconds to download.
; GetSecondsToDownload calculates the amount of time between $DownloadStartTime
; and now, and stores the results into $SecondsToDownload.
Function GetSecondsToDownload
GetTempFileName $2
GetFileTime $2 $1 $0
@ -922,9 +921,9 @@ Function GetSecondsToDownload
Pop $1
System::Int64Op $1 + $0
Pop $0
System::Int64Op $0 - $SecondsToDownload
Pop $SecondsToDownload
System::Int64Op $SecondsToDownload / 10000000
System::Int64Op $0 - $DownloadStartTime
Pop $4
System::Int64Op $4 / 10000000
Pop $SecondsToDownload
FunctionEnd