+2011-04-03 Giuseppe Scrivano <gscrivano@gnu.org>
+
+ * bootstrap.conf (gnulib_modules): Add `fcntl'.
+
2011-03-26 Giuseppe Scrivano <gscrivano@gnu.org>
* configure.ac: Fix the gnutls detection.
c-ctype
close
connect
+fcntl
getaddrinfo
getopt-gnu
getpass-gnu
+2011-04-03 Giuseppe Scrivano <gscrivano@gnu.org>
+
+ * gnutls.c: Include <fcntl.h>
+ (wgnutls_peek): Make the socket non blocking before attempt a read.
+
2011-03-31 Giuseppe Scrivano <gscrivano@gnu.org>
* recur.c (download_child_p): When --no-parent is used, check that the
#include <gnutls/gnutls.h>
#include <gnutls/x509.h>
+#include <fcntl.h>
#include "utils.h"
#include "connect.h"
if (bufsize > offset)
{
+ int flags;
+ flags = fcntl (fd, F_GETFL, 0);
+ if (flags < 0)
+ return ret;
+
+ ret = fcntl (fd, F_SETFL, flags | O_NONBLOCK);
+ if (ret < 0)
+ return ret;
+
do
{
ret = gnutls_record_recv (ctx->session, buf + offset,
ret);
ctx->peeklen += ret;
}
+
+ fcntl (fd, F_SETFL, flags);
+ if (ret < 0)
+ return ret;
}
return offset + ret;