Skip to content

Commit

Permalink
Return non-blocking socket from openconnect_open_https()
Browse files Browse the repository at this point in the history
All the callers just set it to blocking mode again immediately, but we're
working on that...

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed May 12, 2012
1 parent 15a029a commit 458d20d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions cstp.c
Expand Up @@ -111,6 +111,9 @@ static int start_cstp_connection(struct openconnect_info *vpninfo)
}

retry:
/* We don't cope with nonblocking mode... yet */
fcntl(vpninfo->ssl_fd, F_SETFL, fcntl(vpninfo->ssl_fd, F_GETFL) & ~O_NONBLOCK);

openconnect_SSL_printf(vpninfo, "CONNECT /CSCOSSLC/tunnel HTTP/1.1\r\n");
openconnect_SSL_printf(vpninfo, "Host: %s\r\n", vpninfo->hostname);
openconnect_SSL_printf(vpninfo, "User-Agent: %s\r\n", vpninfo->useragent);
Expand Down
3 changes: 3 additions & 0 deletions http.c
Expand Up @@ -640,6 +640,9 @@ int openconnect_obtain_cookie(struct openconnect_info *vpninfo)
return -EINVAL;
}

/* We don't cope with nonblocking mode... yet */
fcntl(vpninfo->ssl_fd, F_SETFL, fcntl(vpninfo->ssl_fd, F_GETFL) & ~O_NONBLOCK);

/*
* It would be nice to use cURL for this, but we really need to guarantee
* that we'll be using OpenSSL (for the TPM stuff), and it doesn't seem
Expand Down
3 changes: 0 additions & 3 deletions ssl.c
Expand Up @@ -1173,9 +1173,6 @@ int openconnect_open_https(struct openconnect_info *vpninfo)
vpn_progress(vpninfo, PRG_INFO, _("Connected to HTTPS on %s\n"),
vpninfo->hostname);

/* Stick it back in blocking mode for now... */
fcntl(ssl_sock, F_SETFL, fcntl(ssl_sock, F_GETFL) & ~O_NONBLOCK);

return 0;
}

Expand Down

0 comments on commit 458d20d

Please sign in to comment.