mailru / graphite-nginx-module

An nginx module for collecting stats into Graphite
135 stars 34 forks source link

ngx_http_graphite_ssl_session_reused breaks nginx tests #54

Open hfrog opened 9 months ago

hfrog commented 9 months ago

Hello, I've noticed that this part of code breaks nginx tests

#if (NGX_SSL)
static ngx_int_t
ngx_http_graphite_ssl_session_reused(ngx_http_request_t *r, ngx_http_variable_value_t *v, uintptr_t data) {

    ngx_str_t s;

    if (r->connection->requests == 1) {
        if (r->connection->ssl && SSL_session_reused(r->connection->ssl->connection)) {
            ngx_str_set(&s, "yes");
        }
        else {
            ngx_str_set(&s, "no");
        }
    }
    else {
        ngx_str_set(&s, "none");
    }

This is because nginx have the same variable $ssl_session_reused, but it has values 'r'/'.' instead of 'yes'/'no'.