curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: Hint: curl timeout simulation

From: Daniel F via curl-library <curl-library_at_lists.haxx.se>
Date: Thu, 02 Sep 2021 15:21:17 +0200

W dniu 2021-09-02 09:58, Daniel Stenberg via curl-library napisaƂ(a):
> On Wed, 1 Sep 2021, David Caul via curl-library wrote:
>
>> 1. can we simulate the curl timeout in code.
>
> Maybe just make a stub function that instead of calling libcurl
> returns CURLE_OPERATION_TIMEDOUT ?

If you are on Linux, you can use this function to shut down receiving
packets on given socket fd. For more details check "man 3 shutdown".
This is probably the easiest way to simulate network timeouts:

shutdown(fd, SHUT_RD);

Regards,
Daniel
-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2021-09-02