]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: ssl: review polling on reneg.
authorEmeric Brun <ebrun@exceliance.fr>
Thu, 8 Nov 2012 16:56:20 +0000 (17:56 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 12 Nov 2012 10:41:16 +0000 (11:41 +0100)
SSL may return SSL_ERROR_WANT_WRITE or SSL_ERROR_WANT_READ when switching
from data to handshake even if it does not need to poll first.

src/ssl_sock.c

index f19e0a74b9886458cf7eeacedf8af56ed62c180f..2fba79b9d09fbc92beb35c4dffce62498f6f068c 100644 (file)
@@ -978,9 +978,9 @@ static int ssl_sock_to_buf(struct connection *conn, struct buffer *buf, int coun
                else {
                        ret =  SSL_get_error(conn->xprt_ctx, ret);
                        if (ret == SSL_ERROR_WANT_WRITE) {
-                               /* handshake is running, and it needs to poll for a write event */
+                               /* handshake is running, and it needs to enable write */
                                conn->flags |= CO_FL_SSL_WAIT_HS;
-                               __conn_sock_poll_send(conn);
+                               __conn_sock_want_send(conn);
                                break;
                        }
                        else if (ret == SSL_ERROR_WANT_READ) {
@@ -1061,13 +1061,9 @@ static int ssl_sock_from_buf(struct connection *conn, struct buffer *buf, int fl
                                break;
                        }
                        else if (ret == SSL_ERROR_WANT_READ) {
-                               /* handshake is running, and
-                                  it needs to poll for a read event,
-                                  write polling must be disabled cause
-                                  we are sure we can't write anything more
-                                  before handshake re-performed */
+                               /* handshake is running, and it needs to enable read */
                                conn->flags |= CO_FL_SSL_WAIT_HS;
-                               __conn_sock_poll_recv(conn);
+                               __conn_sock_want_recv(conn);
                                break;
                        }
                        goto out_error;