curl-library
[PATCH] Call progress function when poll()/select() is interrupted
Date: Sat, 12 Apr 2008 05:05:14 +0200
Hello,
This patch makes the progress update function get called when
poll()/select() in select.c are interrupted by a signal. As discussed in
the previous thread (http://curl.haxx.se/mail/lib-2008-03/0011.html),
the purpose is to allow applications using libcurl to cleanly abort
operations upon receiving a signal in the middle of performing a request
with libcurl.
The progress update function can call a user-defined progress callback,
which lets the user abort the request by returning an error value.
Assuming that select.c is (should be) the only place where libcurl
blocks (on poll()/select()), a signal will now interrupt the blocking
call, run the progress callback, and give the user the possibility to
abort if it has to, instead of looping back to poll()/select() and
blocking for an unknown amount of time.
The patch is based on the source code of the new 7.18.1 release.
Regards,
-- Pierre Ynard "Une âme dans un corps, c'est comme un dessin sur une feuille de papier."
- text/x-diff attachment: curl.patch