cURL / Mailing Lists / curl-library / Single Mail

curl-library

Bug: curl 7.18.2/7.19.2 looses timeouts

From: <koettermarkus_at_gmx.de>
Date: Sat, 15 Nov 2008 07:07:07 +0100

Hi,

I'm having issues with curl 7.18.2 on ubuntu x86_64 smp

curl 7.18.2 (x86_64-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.8g
zlib/1.2.3.3 libidn/1.8
Protocols: tftp ftp telnet dict ldap ldaps http file https ftps
Features: GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz

(I tried 7.19.2 build from source as well, same problem)

I'm using the curl_multi_socket interface, to download via http.

The hiperfifo.c code from doc/examples is outdated as it does not use
curl_multi_socket_action, and uses curl_multi_socket_all for no obvious
reason, but it fits perfectly to describe my problem.

Extending the hiperfifo code by:

   curl_easy_setopt(conn->easy, CURLOPT_LOW_SPEED_TIME, 3L);
   curl_easy_setopt(conn->easy, CURLOPT_LOW_SPEED_LIMIT, 10L);

around line 315,

and compiling&starting it.

starting netcat6 as a dumb listener which does nothing but accepting
connections:

nc6 --continuous --exec /dev/null -l -p 8087

start a *single* download by writing the url to our netcat listener to
the fifo
echo "http://localhost:8087" > /tmp/hiper.fifo

One can see, that this session never times out, the timer_cb callback
gets called *once*, but the session is not removed for being too slow.

But: sometimes it works!
In this case the timer_cb gets called and installs another timer_cb,
which times out the connection as expected (too_slow).

I found it to be a timing issue, a valid way to delay the program -to
break it- was running it in valgrind or gdb with breakpoint on Curl_expire.
Therefore if it works for you, run it in valgrind or gdb and it will not.

As I've been unable to figure out whats going wrong I'm not sending in a
patch to fix the problem.

MfG
Markus

P.S.: the modified (above 2 lines) hiperfifo code did not work at all
here, a heavy modified hiperfifo to use libev instead of libevent
*sometimes* closes the connection with too_slow.
Received on 2008-11-15