cURL / Mailing Lists / curl-library / Single Mail


Re: [PATCH] Call progress function when poll()/select() is interrupted

From: Daniel Stenberg <>
Date: Mon, 14 Apr 2008 15:48:30 +0200 (CEST)

On Sat, 12 Apr 2008, Pierre Ynard wrote:

> 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 (, 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.


I'm in favor of doing this, but I have a minor issue with it that I think we
should fix:

The use of "magic numbers" are increased a lot. And by magic numbers I mean
that the existing (before this patch) uses explit checks for -1 and 0 on
multiple places and that is already a bit on the bad side - as using named
defines would much more readable by somewhat removing the need to lookup what
the number actually means. Adding -2 to the pile thus makes the code even
worse in that aspect.

Do you think you could add some defines for these magic return codes and make
the code use them instead?

  Commercial curl and libcurl Technical Support:
Received on 2008-04-14