Use HttpClient.Download for timestamp download
This commit is contained in:
parent
d7dc233fb0
commit
574a8a7f51
2 changed files with 4 additions and 21 deletions
|
@ -860,7 +860,6 @@ End
|
|||
|
||||
Public Sub GetOfflineState() As Integer
|
||||
|
||||
Dim hClient As HttpClient
|
||||
Dim sTimestamp As String
|
||||
Dim sDir As String
|
||||
Dim sDate As String
|
||||
|
@ -868,17 +867,7 @@ Public Sub GetOfflineState() As Integer
|
|||
If Not Desktop.NetworkAvailable Then Return OFFLINE_NO_NETWORK
|
||||
|
||||
Inc Application.Busy
|
||||
|
||||
hClient = New HttpClient As "hClient"
|
||||
hClient.Async = False
|
||||
hClient.Timeout = 20
|
||||
|
||||
hClient.URL = "http://gambaswiki.org/timestamp"
|
||||
hClient.Get
|
||||
If hClient.Status >= 0 Then
|
||||
If Lof(hClient) Then sTimestamp = Read #hClient, Lof(hClient)
|
||||
End If
|
||||
|
||||
sTimestamp = HttpClient.Download("http://gambaswiki.org/timestamp")
|
||||
Dec Application.Busy
|
||||
|
||||
sTimestamp = Trim(sTimestamp)
|
||||
|
|
|
@ -1176,7 +1176,6 @@ End
|
|||
Public Sub btnDownloadHelp_Click()
|
||||
|
||||
Dim hClient As HttpClient
|
||||
Dim sHeaders As New String[0]
|
||||
Dim sMsg As String
|
||||
Dim sFile As String
|
||||
Dim sDir As String
|
||||
|
@ -1195,18 +1194,13 @@ Public Sub btnDownloadHelp_Click()
|
|||
sFile = sParentDir &/ "wiki.tar.bz2"
|
||||
Try Kill sFile
|
||||
|
||||
sTimestamp = HttpClient.Download("http://gambaswiki.org/timestamp")
|
||||
|
||||
hClient = New HttpClient As "hClient"
|
||||
hClient.Async = False
|
||||
hClient.Timeout = 20
|
||||
|
||||
hClient.URL = "http://gambaswiki.org/timestamp"
|
||||
hClient.Get
|
||||
If hClient.Status >= 0 Then
|
||||
If Lof(hClient) Then sTimestamp = Read #hClient, Lof(hClient)
|
||||
End If
|
||||
|
||||
hClient.URL = "http://gambaswiki.org/gambas-wiki.tar.bz2"
|
||||
hClient.Get(sHeaders, sFile)
|
||||
hClient.Get([], sFile)
|
||||
|
||||
If Not Exist(sFile) Then
|
||||
sMsg = ("Unable to download documentation.")
|
||||
|
|
Loading…
Reference in a new issue