Skip to content

Commit

Permalink
[cHttpRequest] Allow timeout for WaitForResponse in seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
wqweto committed Oct 8, 2023
1 parent f6a4d1a commit 146b1f4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion contrib/cHttpRequest.cls
Original file line number Diff line number Diff line change
Expand Up @@ -557,10 +557,16 @@ End Sub

Public Function WaitForResponse(Optional ByVal Timeout As Variant) As Boolean
Const FUNC_NAME As String = "WaitForResponse"
Dim lTimeoutMs As Long

On Error GoTo EH
m_vLastError = Empty
If Not pvWaitForState(ucsWaitRecvBody, IIf(Not IsMissing(Timeout), Timeout, -1)) Then
If Not IsMissing(Timeout) Then
lTimeoutMs = IIf(Timeout < 100, Timeout * 1000, Timeout)
Else
lTimeoutMs = -1
End If
If Not pvWaitForState(ucsWaitRecvBody, lTimeoutMs) Then
GoTo QH
End If
'--- success
Expand Down

0 comments on commit 146b1f4

Please sign in to comment.