X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=src%2Fgnutls.c;fp=src%2Fgnutls.c;h=2db5a90c5806d65b6d45eaf9b1dc45e66ed0416b;hp=2a1d22b9ed3ad91a942d5a0261a961e776b6371d;hb=3bb17fca04e792fe9668365e2c2af43fdbedafea;hpb=2541e0b57933dc4bf39284b127bfaaf67868c040 diff --git a/src/gnutls.c b/src/gnutls.c index 2a1d22b9..2db5a90c 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -1,5 +1,5 @@ /* SSL support via GnuTLS library. - Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software + Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This file is part of GNU Wget. @@ -160,9 +160,13 @@ wgnutls_read_timeout (int fd, char *buf, int bufsize, void *arg, double timeout) do { - double next_timeout = timeout - ptimer_measure (timer); - if (timeout && next_timeout < 0) - break; + double next_timeout; + if (timeout > 0.0) + { + next_timeout = timeout - ptimer_measure (timer); + if (next_timeout < 0.0) + break; + } ret = GNUTLS_E_AGAIN; if (timeout == 0 || gnutls_record_check_pending (ctx->session)