Skip to content

Commit 6bebafa

Browse files
committed
Merge pull request #34 from timhall/timeout-long
Convert timeout to Long
2 parents 4c5bede + 4288e39 commit 6bebafa

File tree

8 files changed

+13
-264
lines changed

8 files changed

+13
-264
lines changed

authenticators/FacebookAuthenticator.cls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ Private Function TokenRequest() As RestRequest
227227
TokenRequest.AddQuerystringParam "redirect_uri", RedirectUri
228228
End Function
229229

230-
Private Function OAuthIsComplete(IE As InternetExplorer) As Boolean
230+
Private Function OAuthIsComplete(IE As Object) As Boolean
231231
If Not IE.Busy And IE.readyState = 4 Then
232232
If OAuthIsSuccessful(IE) Or OAuthIsDenied(IE) Then
233233
OAuthIsComplete = True

authenticators/GoogleAuthenticator.cls

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,20 @@ Attribute VB_Exposed = True
2424
' https://developers.google.com/oauthplayground/
2525
'
2626
' @example
27-
'
27+
'
2828
' Dim Auth As New GoogleAuthenticator
2929
' Auth.Setup "Your Client Id", "Your Client Secret"
30-
'
30+
'
3131
' ' Enable analytics scope and add YouTube scope
3232
' Auth.EnableScope("analytics")
3333
' Auth.AddScope("https://www.googleapis.com/auth/yt-analytics.readonly")
34-
'
34+
'
3535
' ' Open up Google login
3636
' Auth.Login
3737
'
3838
' ' or - Use your API key to access your own information
3939
' Auth.ApiKey = "Your Api Key"
40-
'
40+
'
4141
' ' Add authenticator to client
4242
' Set Client.Authenticator = Auth
4343
'

specs/RestClientBaseSpecs.bas

Lines changed: 0 additions & 102 deletions
This file was deleted.

src/IAuthenticator.cls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Attribute VB_Exposed = True
1515
'
1616
1717
' @license: MIT (http://www.opensource.org/licenses/mit-license.php)
18-
'
18+
'
1919
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '
2020
Option Explicit
2121

src/RestClient.cls

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Attribute VB_Exposed = True
1919
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '
2020
Option Explicit
2121

22-
Private Const DefaultTimeoutMS As Integer = 5000
22+
Private Const DefaultTimeoutMS As Long = 5000
2323

2424

2525
' --------------------------------------------- '
@@ -28,7 +28,7 @@ Private Const DefaultTimeoutMS As Integer = 5000
2828

2929
Public BaseUrl As String
3030
Public Authenticator As IAuthenticator
31-
Public TimeoutMS As Integer
31+
Public TimeoutMS As Long
3232
Public ProxyServer As String
3333
Public ProxyUsername As String
3434
Public ProxyPassword As String
@@ -80,7 +80,7 @@ Public Function ExecuteAsync(Request As RestRequest, Callback As String, Optiona
8080

8181
' Setup the request
8282
Set Http = HttpSetup(Request, True)
83-
RestHelpers.ExecuteRequestAsync Http, Request, TimeoutMS, Callback, CallbackArgs
83+
RestHelpers.ExecuteRequestAsync Http, Request, Me.TimeoutMS, Callback, CallbackArgs
8484
ExecuteAsync = True
8585
Exit Function
8686

src/RestClientBase.bas

Lines changed: 0 additions & 149 deletions
This file was deleted.

src/RestHelpers.bas

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ End Function
406406
' @return {Object} Setup http object
407407
' --------------------------------------------- '
408408

409-
Public Function PrepareHttpRequest(Request As RestRequest, TimeoutMS As Integer, _
409+
Public Function PrepareHttpRequest(Request As RestRequest, TimeoutMS As Long, _
410410
Optional UseAsync As Boolean = False) As Object
411411
Dim Http As Object
412412
Set Http = CreateObject("MSXML2.ServerXMLHTTP.6.0")
@@ -517,7 +517,7 @@ End Function
517517
' @param {Variant} [CallbackArgs] Variable array of arguments that get passed directly to callback function
518518
' --------------------------------------------- '
519519

520-
Public Sub ExecuteRequestAsync(ByRef Http As Object, ByRef Request As RestRequest, TimeoutMS As Integer, Callback As String, Optional ByVal CallbackArgs As Variant)
520+
Public Sub ExecuteRequestAsync(ByRef Http As Object, ByRef Request As RestRequest, TimeoutMS As Long, Callback As String, Optional ByVal CallbackArgs As Variant)
521521
On Error GoTo ErrorHandling
522522

523523
Request.Callback = Callback
@@ -729,7 +729,7 @@ End Function
729729
' @param {RestRequest} Request
730730
' @param {Long} TimeoutMS
731731
' --------------------------------------------- '
732-
Public Sub StartTimeoutTimer(Request As RestRequest, TimeoutMS As Integer)
732+
Public Sub StartTimeoutTimer(Request As RestRequest, TimeoutMS As Long)
733733
SetTimer Application.HWnd, ObjPtr(Request), TimeoutMS, AddressOf RestHelpers.TimeoutTimerExpired
734734
End Sub
735735

src/RestRequest.cls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ End Sub
392392
'
393393
' --------------------------------------------- '
394394

395-
Public Sub StartTimeoutTimer(TimeoutMS As Integer)
395+
Public Sub StartTimeoutTimer(TimeoutMS As Long)
396396
RestHelpers.StartTimeoutTimer Me, TimeoutMS
397397
End Sub
398398

0 commit comments

Comments
 (0)