Re: request assistance resolving a std.net.curl segmentation fault

2023-05-24 Thread anonymouse via Digitalmars-d-learn
On Saturday, 20 May 2023 at 09:20:54 UTC, kdevel wrote: What if the internet connection is not re-established within an reasonable amount of time? What if the resource is no longer available on the server (HTTP eror 404 [1])? If there is an interactive user: Wouldn't it be better have the

Re: request assistance resolving a std.net.curl segmentation fault

2023-05-20 Thread kdevel via Digitalmars-d-learn
On Friday, 19 May 2023 at 23:36:28 UTC, anonymouse wrote: [...] The reason I used a while loop was to detect loss of internet connection and resume the process once the connection is re-established. What if the internet connection is not re-established within an reasonable amount of time?

Re: request assistance resolving a std.net.curl segmentation fault

2023-05-19 Thread anonymouse via Digitalmars-d-learn
On Friday, 19 May 2023 at 12:40:29 UTC, Danny Arends wrote: On Friday, 19 May 2023 at 11:07:01 UTC, anonymouse wrote: What am I doing wrong here? [SNIP] You're running the whole thing in a while(TRUE) loop, recreating the curl object re-initiating the transfer and file pointer, etc. The

Re: request assistance resolving a std.net.curl segmentation fault

2023-05-19 Thread anonymouse via Digitalmars-d-learn
On Friday, 19 May 2023 at 12:28:20 UTC, kdevel wrote: On Friday, 19 May 2023 at 11:07:01 UTC, anonymouse wrote: What am I doing wrong here? [...] curl.set(CurlOption.writedata, ); According to [1] this line must read ``` curl.set(CurlOption.writedata, cast (void *)

Re: request assistance resolving a std.net.curl segmentation fault

2023-05-19 Thread anonymouse via Digitalmars-d-learn
On Friday, 19 May 2023 at 12:28:20 UTC, kdevel wrote: On Friday, 19 May 2023 at 11:07:01 UTC, anonymouse wrote: What am I doing wrong here? [...] curl.set(CurlOption.writedata, ); According to [1] this line must read ``` curl.set(CurlOption.writedata, cast (void *)

Re: request assistance resolving a std.net.curl segmentation fault

2023-05-19 Thread Danny Arends via Digitalmars-d-learn
On Friday, 19 May 2023 at 11:07:01 UTC, anonymouse wrote: What am I doing wrong here? ```D import std.net.curl: Curl, CurlOption, CurlException; import std.file: exists; import std.stdio: File, writefln; import core.thread: Thread; void downloadFile(string url, string filename) { while

Re: request assistance resolving a std.net.curl segmentation fault

2023-05-19 Thread kdevel via Digitalmars-d-learn
On Friday, 19 May 2023 at 11:07:01 UTC, anonymouse wrote: What am I doing wrong here? [...] curl.set(CurlOption.writedata, ); According to [1] this line must read ``` curl.set(CurlOption.writedata, cast (void *) fp.getFP()); ``` [1]

request assistance resolving a std.net.curl segmentation fault

2023-05-19 Thread anonymouse via Digitalmars-d-learn
What am I doing wrong here? ```D import std.net.curl: Curl, CurlOption, CurlException; import std.file: exists; import std.stdio: File, writefln; import core.thread: Thread; void downloadFile(string url, string filename) { while (true) { try { File fp; if