On Fri, Jan 17, 2014 at 11:03:51AM +0100, Willy Tarreau wrote: > On Fri, Jan 17, 2014 at 10:47:01AM +0100, Willy Tarreau wrote: > > So I might have broken something in the way to count the "try" value, > > ending up with zero being selected and nothing done. Unfortunately it > > works fine here. > > OK I can reproduce it in 32-bit now. Let's see what happens...
OK here's the fix. I'm ashamed for not having noticed this mistake during the change. I ported the raw_sock changes to ssl_sock, it was pretty straght-forward but I missed the condition in the while () loop. And unfortunately, the variable happened to be non-zero in the stack, resulting in something working well for me :-/ I've pushed the fix. Thanks guys. Willy ---- >From 00b0fb9349b8842a5ec2cee9dc4f286c8d3a3685 Mon Sep 17 00:00:00 2001 From: Willy Tarreau <w...@1wt.eu> Date: Fri, 17 Jan 2014 11:09:40 +0100 Subject: BUG/MAJOR: ssl: fix breakage caused by recent fix abf08d9 MIME-Version: 1.0 Content-Type: text/plain; charset=latin1 Content-Transfer-Encoding: 8bit Recent commit abf08d9 ("BUG/MAJOR: connection: fix mismatch between rcv_buf's API and usage") accidentely broke SSL by relying on an uninitialized value to enter the read loop. Many thanks to Cyril Bonté and Steve Ruiz for reporting this issue. --- src/ssl_sock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ssl_sock.c b/src/ssl_sock.c index 7120ff8..87a2a58 100644 --- a/src/ssl_sock.c +++ b/src/ssl_sock.c @@ -1353,7 +1353,7 @@ static int ssl_sock_to_buf(struct connection *conn, struct buffer *buf, int coun * in which case we accept to do it once again. A new attempt is made on * EINTR too. */ - while (try) { + while (count > 0) { /* first check if we have some room after p+i */ try = buf->data + buf->size - (buf->p + buf->i); /* otherwise continue between data and p-o */ -- 1.7.12.1