request assistance resolving a std.net.curl segmentation fault

anonymouse anony at mouse.com
Thu May 25 00:33:39 UTC 2023


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 user restart 
> the download at his discretion?

I am the interactive user but I'm usually not on site to monitor 
it while this is happening.

>> What would have been a better approach?
>
> That depends on where you want to use that download function. 
> If it is intended to download a full software update of a 
> modern e-vehicle I would suggest not to use such an endless 
> loop. I would limit the retries to a low single-digit number 
> greater than one and of log the event.

Noted.

> ```
> ubyte [<?>] buf;
> curl.set (CurlOption.errorbuffer, buf.ptr);
> ```
>
> to store that result.

Okay. Got it. Thank you.


More information about the Digitalmars-d-learn mailing list