#include "ptimer.h"
#include "ssl.h"
+#include <sys/fcntl.h>
+
#ifdef WIN32
# include "w32sock.h"
#endif
bool
ssl_init ()
{
+ /* Becomes true if GnuTLS is initialized. */
+ static bool ssl_initialized = false;
+
+ /* GnuTLS should be initialized only once. */
+ if (ssl_initialized)
+ return true;
+
const char *ca_directory;
DIR *dir;
if (opt.ca_cert)
gnutls_certificate_set_x509_trust_file (credentials, opt.ca_cert,
GNUTLS_X509_FMT_PEM);
+
+ ssl_initialized = true;
+
return true;
}
static int
wgnutls_read (int fd, char *buf, int bufsize, void *arg)
{
-#ifdef F_GETFL
- int flags = 0;
-#endif
int ret = 0;
- struct ptimer *timer;
struct wgnutls_transport_context *ctx = arg;
if (ctx->peeklen)