It is currently Tue Jul 23, 2019 12:38 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: [Done] Bug Maybe? wih #PB_HTTP_Asynchronous?
PostPosted: Fri Oct 20, 2017 7:45 am 
Offline
Enthusiast
Enthusiast

Joined: Mon Jan 20, 2014 6:32 pm
Posts: 237
I am not sure if this is a bug or what is causing it. I havent tested on windows as I dont have a system on hand. It seems to have no problem running on linux but in osx it crashes everytime with this.

Code:
  InitNetwork()

  Download = ReceiveHTTPMemory("http://www.oroeditions.com/la-journal", #PB_HTTP_Asynchronous)
  If Download
    Repeat
      Progress = HTTPProgress(Download)
      Select Progress
        Case #PB_Http_Success
          *Buffer = FinishHTTP(Download)
          Debug "Download finished (size: " + MemorySize(*Buffer) + ")"
          FreeMemory(*Buffer)
          End

        Case #PB_Http_Failed
          Debug "Download failed"
          End

        Case #PB_Http_Aborted
          Debug "Download aborted"
          End
         
        Default
          Debug "Current download: " + Progress
       
      EndSelect
     
      Delay(500) ; Don't stole the whole CPU
    ForEver
  Else
    Debug "Download error"
  EndIf

_________________
WARNING: I dont know what I am doing! I just put stuff here and there and sometimes like magic it works. So please improve on my code and post your changes so I can learn more. TIA


Top
 Profile  
Reply with quote  
 Post subject: Re: Bug Maybe? wih #PB_HTTP_Asynchronous?
PostPosted: Fri Oct 20, 2017 8:44 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Apr 29, 2003 9:18 pm
Posts: 1459
Location: North by Northwest
Had the same problem several month ago with an earlier version of PureBasic.
The only thing that made my code work was switching to synchronous mode.
Just to make sure it's not a platform issue I rewrote my code to Go and it worked beautifully.
Since then I'm using the Go version...

Thought I reported the bug, but I can't find it on this forum.
So maybe I never did report it.
Shame on me...
:(

_________________

I am to provide the public with beneficial shocks.
Alfred Hitshock


Top
 Profile  
Reply with quote  
 Post subject: Re: Bug Maybe? wih #PB_HTTP_Asynchronous?
PostPosted: Sat Oct 21, 2017 7:17 am 
Offline
Addict
Addict
User avatar

Joined: Thu Apr 21, 2005 2:38 pm
Posts: 1631
Location: Germany
vwidmer wrote:
I am not sure if this is a bug or what is causing it.

It seems to be a bug indeed. deseven posted it already in the MacOS bug forum. Although you may try it with 32 bit compilation as mk-soft reports in that thread that 32 bit is working...

dige also posted this bug report (unfortunately in "General Discussion") about an IMA with asynchronous ReceiveHTTPMemory (presumably in Windows).

fsw wrote:
Thought I reported the bug, but I can't find it on this forum.
So maybe I never did report it.

Unfortunately you mentioned your problem with #PB_HTTP_Asynchronous in "Feature Requests and Wishlists" under the topic "Arm Processors support":
fsw wrote:
However, sometimes I find myself writing Go code to do certain things and package them as executables that I call from PureBasic GUI apps.
(like writing my own ReceiveHTTPFile implementation, because as soon as I add the #PB_HTTP_Asynchronous flag the PureBasic program crashes [on macOS] while downloading a 20MB file; KB sized files seem to work though...)


Top
 Profile  
Reply with quote  
 Post subject: Re: Bug Maybe? wih #PB_HTTP_Asynchronous?
PostPosted: Sat Oct 21, 2017 8:15 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Apr 29, 2003 9:18 pm
Posts: 1459
Location: North by Northwest
Shardik wrote:
fsw wrote:
Thought I reported the bug, but I can't find it on this forum.
So maybe I never did report it.

Unfortunately you mentioned your problem with #PB_HTTP_Asynchronous in "Feature Requests and Wishlists" under the topic "Arm Processors support":
fsw wrote:
However, sometimes I find myself writing Go code to do certain things and package them as executables that I call from PureBasic GUI apps.
(like writing my own ReceiveHTTPFile implementation, because as soon as I add the #PB_HTTP_Asynchronous flag the PureBasic program crashes [on macOS] while downloading a 20MB file; KB sized files seem to work though...)

That's why I couldn't find it.
:oops:

_________________

I am to provide the public with beneficial shocks.
Alfred Hitshock


Top
 Profile  
Reply with quote  
 Post subject: Re: [Done] Bug Maybe? wih #PB_HTTP_Asynchronous?
PostPosted: Fri Apr 26, 2019 4:49 pm 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 13595
Location: France
Fixed.


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


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