curl-library
[PATCH] speedcheck.c disabling expire
Date: Wed, 07 Sep 2011 12:19:37 -0300
Dear all,
I'm submitting patch to fix incorrect handling of Curl_expire by
speedcheck.c. The current version of speedcheck.c may disable timeout by
setting zero to Curl_expire. Which is fine using the curl_multi_perform,
because it recheck all timeout internals, but when using custom event
poller (like hiperfifo.c) it may keep stalle connection forever.
Steps to reproduce the bug:
1) Compile the attached hiperfifo.c (added
CURLOPT_LOW_SPEED_TIME/CURLOPT_LOW_SPEED_LIMIT).
2) Run the hiperfifo
3) In another terminal let the netcat listening with nc -l -p 8080
4) Pipe the URL http://127.0.0.1:8080 to hiper.fifo
The timeout will be disabled and the low speed don't will be respected.
The connection will last forever. If any byte is sent by server (nc) the
expire will be enabled again and aborted.
Kind Regards
Adriano Aurelio Meirelles
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
- text/plain attachment: speedcheck.diff
- text/x-c attachment: hiperfifo.c