It is currently Sat Nov 28, 2020 12:10 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: HTTPProxy() + async HTTPRequest() error
PostPosted: Tue Mar 17, 2020 10:12 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Mar 25, 2004 2:15 pm
Posts: 724
Location: Spain
Hello :D

This code fails randomly when I activate HTTPProxy() with a
Quote:
the debugged executable quit unexpectedly


(if I deactivate it it is executed correctly)

PB 5.71 LTS x64, Windows 10 x64
Code:
InitNetwork()

Repeat
 
  If status = 0
    HTTPProxy("http://159.203.45.27:8080")
   
    HttpRequest = HTTPRequest(#PB_HTTP_Get, "https://www.google.com", "", #PB_HTTP_Asynchronous)
    If HttpRequest
      status = 1
      Debug "started"
    EndIf
  EndIf
 
  If status = 1
    Progress = HTTPProgress(HttpRequest)
    Delay(1000)
   
    If progress
      Debug Progress
    Else
      FinishHTTP(HTTPRequest)
      status = 0
    EndIf
   
    If status And Progress = #PB_HTTP_Success Or Progress = #PB_HTTP_Failed Or Progress = #PB_HTTP_Aborted
     
      If Progress = #PB_HTTP_Success
        *Buffer = HTTPMemory(HTTPRequest)
        Debug PeekS(*Buffer, MemorySize(*Buffer), #PB_UTF8|#PB_ByteLength)
        FreeMemory(*Buffer)
      EndIf
     
      FinishHTTP(HTTPRequest)
      status = 0
      Debug "finished"
    EndIf
  EndIf
 Delay(1000)
ForEver



PS: I know that proxy is currently google-banned, but that's another story :)

_________________
PB 5.7x, PureVision User.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: wombats and 26 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye