From 8d764f3ac6f086cee848e1181bdd80a39e8959e4 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Sun, 17 Apr 2011 13:07:01 +0200 Subject: [PATCH] Use correctly FIONBIO values. --- src/ChangeLog | 7 +++++++ src/gnutls.c | 8 ++++---- src/wget.h | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 548de629..39390a5f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2011-04-17 Giuseppe Scrivano + + * wget.h [HAVE_LIBSSL32]: Define HAVE_SSL. + + * gnutls.c (wgnutls_peek): Use correctly FIONBIO codes under Mingw32. + Reported by: Ray Satiro + 2011-04-13 Giuseppe Scrivano * openssl.c (openssl_poll): Check if the specified timeout is zero after diff --git a/src/gnutls.c b/src/gnutls.c index 564170fe..a1054a4d 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -197,8 +197,8 @@ wgnutls_peek (int fd, char *buf, int bufsize, void *arg) return ret; #else /* XXX: Assume it was blocking before. */ - const int zero = 0; - ret = ioctl (fd, FIONBIO, &zero); + const int one = 1; + ret = ioctl (fd, FIONBIO, &one); if (ret < 0) return ret; #endif @@ -224,8 +224,8 @@ wgnutls_peek (int fd, char *buf, int bufsize, void *arg) if (ret < 0) return ret; #else - const int one = 1; - ret = ioctl (fd, FIONBIO, &one); + const int zero = 0; + ret = ioctl (fd, FIONBIO, &zero); if (ret < 0) return ret; #endif diff --git a/src/wget.h b/src/wget.h index fce89e7a..c7c5e2cb 100644 --- a/src/wget.h +++ b/src/wget.h @@ -52,7 +52,7 @@ as that of the covered work. */ #endif /* Is OpenSSL or GNUTLS available? */ -#if defined HAVE_LIBSSL || defined HAVE_LIBGNUTLS +#if defined HAVE_LIBSSL || defined HAVE_LIBSSL32 || defined HAVE_LIBGNUTLS # define HAVE_SSL #endif