]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: ssl: cache doesn't release shctx blocks
authorWilliam Lallemand <wlallemand@haproxy.com>
Wed, 3 Jan 2018 18:15:51 +0000 (19:15 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 5 Jan 2018 10:46:54 +0000 (11:46 +0100)
Since the rework of the shctx with the hot list system, the ssl cache
was putting session inside the hot list, without removing them.
Once all block were used, they were all locked in the hot list, which
was forbiding to reuse them for new sessions.

Bug introduced by 4f45bb9 ("MEDIUM: shctx: separate ssl and shctx")

Thanks to Jeffrey J. Persch for reporting this bug.

Must be backported to 1.8.

src/ssl_sock.c

index 163b6a13fe1796d3a598706fe575ae4aab007eb9..aecf3ddb7c57f55da25d85ae231d5db8262053ee 100644 (file)
@@ -3849,8 +3849,12 @@ static int sh_ssl_sess_store(unsigned char *s_id, unsigned char *data, int data_
                first->len = sizeof(struct sh_ssl_sess_hdr);
        }
 
-       if (shctx_row_data_append(ssl_shctx, first, data, data_len) < 0)
+       if (shctx_row_data_append(ssl_shctx, first, data, data_len) < 0) {
+               shctx_row_dec_hot(ssl_shctx, first);
                return 0;
+       }
+
+       shctx_row_dec_hot(ssl_shctx, first);
 
        return 1;
 }