diff --git a/src/ssl_sock.c b/src/ssl_sock.c index cd200283e9..92e78e80b0 100644 --- a/src/ssl_sock.c +++ b/src/ssl_sock.c @@ -226,11 +226,11 @@ static int ha_ssl_write(BIO *h, const char *buf, int num) tmpbuf.head = 0; flags = (ctx->xprt_st & SSL_SOCK_SEND_MORE) ? CO_SFL_MSG_MORE : 0; ret = ctx->xprt->snd_buf(ctx->conn, ctx->xprt_ctx, &tmpbuf, num, flags); + BIO_clear_retry_flags(h); if (ret == 0 && !(ctx->conn->flags & (CO_FL_ERROR | CO_FL_SOCK_WR_SH))) { BIO_set_retry_write(h); ret = -1; - } else if (ret == 0) - BIO_clear_retry_flags(h); + } return ret; } @@ -258,11 +258,11 @@ static int ha_ssl_read(BIO *h, char *buf, int size) tmpbuf.data = 0; tmpbuf.head = 0; ret = ctx->xprt->rcv_buf(ctx->conn, ctx->xprt_ctx, &tmpbuf, size, 0); + BIO_clear_retry_flags(h); if (ret == 0 && !(ctx->conn->flags & (CO_FL_ERROR | CO_FL_SOCK_RD_SH))) { BIO_set_retry_read(h); ret = -1; - } else if (ret == 0) - BIO_clear_retry_flags(h); + } return ret; }