From 692ece63a3789180434a3d552e7efe96a4bd9ce0 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Sun, 21 Sep 2008 22:00:06 -0700 Subject: [PATCH] Add comment about poll() handling --- ssl.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ssl.c b/ssl.c index 152526a..5a27abc 100644 --- a/ssl.c +++ b/ssl.c @@ -271,6 +271,12 @@ int ssl_mainloop(struct anyconnect_info *vpninfo, int *timeout) int len; int work_done = 0; + /* FIXME: The poll() handling here is fairly simplistic. Actually, + if the SSL connection stalls it could return a WANT_WRITE error + on _either_ of the SSL_read() or SSL_write() calls. In that case, + we should probably remove POLLIN from the events we're looking for, + and add POLLOUT. As it is, though, it'll just chew CPU time in that + fairly unlikely situation, until the write backlog clears. */ while ( (len = SSL_read(vpninfo->https_ssl, buf, sizeof(buf))) > 0) { if (buf[0] != 'S' || buf[1] != 'T' || -- 2.7.4