diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2021-06-19 20:53:56 -0400 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2021-08-27 02:16:54 -0400 |
commit | e34ce5f2177eb70089549662f42d61e176a75421 (patch) | |
tree | c8ced4940d088b0996fe4c72e48702a01f8a49a1 /src/configfile-glue.c | |
parent | 1ca721d4795676485bc64591438aa59a3ff7bd29 (diff) | |
download | lighttpd-git-e34ce5f2177eb70089549662f42d61e176a75421.tar.gz |
[core] const buffer * in config_check_cond_nocache
use (const buffer *) in config_check_cond_nocache()
Diffstat (limited to 'src/configfile-glue.c')
-rw-r--r-- | src/configfile-glue.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/configfile-glue.c b/src/configfile-glue.c index 1b84b76a..cb3a8ea1 100644 --- a/src/configfile-glue.c +++ b/src/configfile-glue.c @@ -510,7 +510,7 @@ static cond_result_t config_check_cond_nocache(request_st * const r, const data_ /* pass the rules */ - buffer *l; + const buffer *l; switch (dc->comp) { case COMP_HTTP_HOST: @@ -591,28 +591,24 @@ static cond_result_t config_check_cond_nocache(request_st * const r, const data_ break; case COMP_HTTP_REQUEST_HEADER: - *((const buffer **)&l) = - http_header_request_get(r, dc->ext, BUF_PTR_LEN(&dc->comp_tag)); + l = http_header_request_get(r, dc->ext, BUF_PTR_LEN(&dc->comp_tag)); if (NULL == l) l = (buffer *)&empty_string; break; case COMP_HTTP_REQUEST_METHOD: - l = r->tmp_buf; - buffer_clear(l); - http_method_append(l, r->http_method); + { + buffer * const tb = r->tmp_buf; + l = tb; + buffer_clear(tb); + http_method_append(tb, r->http_method); + } break; default: return COND_RESULT_FALSE; } - if (NULL == l) { /*(should not happen)*/ - log_error(r->conf.errh, __FILE__, __LINE__, - "%s compare to NULL", dc->comp_key); - return COND_RESULT_FALSE; - } - else if (debug_cond) { + if (debug_cond) log_error(r->conf.errh, __FILE__, __LINE__, "%s compare to %s", dc->comp_key, l->ptr); - } switch(dc->cond) { case CONFIG_COND_NE: |