summaryrefslogtreecommitdiff
path: root/src/http_header.c
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2019-10-15 23:50:31 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2019-10-15 23:50:31 -0400
commit0740aed15366c8d1c981d269a0c9c68b7ab1fe44 (patch)
tree68f9f969bb7c4bed81a50ca4276131d71414863f /src/http_header.c
parente38e145bea99a7f30c96a7061e1b6f076cec90ff (diff)
downloadlighttpd1.4-0740aed15366c8d1c981d269a0c9c68b7ab1fe44.tar.gz
lighttpd1.4-0740aed15366c8d1c981d269a0c9c68b7ab1fe44.zip
[core] inline header and env arrays into con
Diffstat (limited to 'src/http_header.c')
-rw-r--r--src/http_header.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/http_header.c b/src/http_header.c
index b140530f..747ed0d2 100644
--- a/src/http_header.c
+++ b/src/http_header.c
@@ -100,14 +100,14 @@ static inline buffer * http_header_generic_get_ifnotempty(const array * const a,
buffer * http_header_response_get(connection *con, enum http_header_e id, const char *k, size_t klen) {
return (id <= HTTP_HEADER_OTHER || (con->response.htags & id))
- ? http_header_generic_get_ifnotempty(con->response.headers, k, klen)
+ ? http_header_generic_get_ifnotempty(&con->response.headers, k, klen)
: NULL;
}
void http_header_response_unset(connection *con, enum http_header_e id, const char *k, size_t klen) {
if (id <= HTTP_HEADER_OTHER || (con->response.htags & id)) {
if (id > HTTP_HEADER_OTHER) con->response.htags &= ~id;
- array_set_key_value(con->response.headers, k, klen, CONST_STR_LEN(""));
+ array_set_key_value(&con->response.headers, k, klen, CONST_STR_LEN(""));
}
}
@@ -118,20 +118,20 @@ void http_header_response_set(connection *con, enum http_header_e id, const char
*/
if (id > HTTP_HEADER_OTHER)
(vlen) ? (con->response.htags |= id) : (con->response.htags &= ~id);
- array_set_key_value(con->response.headers, k, klen, v, vlen);
+ array_set_key_value(&con->response.headers, k, klen, v, vlen);
}
void http_header_response_append(connection *con, enum http_header_e id, const char *k, size_t klen, const char *v, size_t vlen) {
if (0 == vlen) return;
if (id > HTTP_HEADER_OTHER) con->response.htags |= id;
- buffer * const vb = array_get_buf_ptr(con->response.headers, k, klen);
+ buffer * const vb = array_get_buf_ptr(&con->response.headers, k, klen);
http_header_token_append(vb, v, vlen);
}
void http_header_response_insert(connection *con, enum http_header_e id, const char *k, size_t klen, const char *v, size_t vlen) {
if (0 == vlen) return;
if (id > HTTP_HEADER_OTHER) con->response.htags |= id;
- buffer * const vb = array_get_buf_ptr(con->response.headers, k, klen);
+ buffer * const vb = array_get_buf_ptr(&con->response.headers, k, klen);
if (!buffer_string_is_empty(vb)) { /* append value */
buffer_append_string_len(vb, CONST_STR_LEN("\r\n"));
buffer_append_string_len(vb, k, klen);
@@ -143,14 +143,14 @@ void http_header_response_insert(connection *con, enum http_header_e id, const c
buffer * http_header_request_get(connection *con, enum http_header_e id, const char *k, size_t klen) {
return (id <= HTTP_HEADER_OTHER || (con->request.htags & id))
- ? http_header_generic_get_ifnotempty(con->request.headers, k, klen)
+ ? http_header_generic_get_ifnotempty(&con->request.headers, k, klen)
: NULL;
}
void http_header_request_unset(connection *con, enum http_header_e id, const char *k, size_t klen) {
if (id <= HTTP_HEADER_OTHER || (con->request.htags & id)) {
if (id > HTTP_HEADER_OTHER) con->request.htags &= ~id;
- array_set_key_value(con->request.headers, k, klen, CONST_STR_LEN(""));
+ array_set_key_value(&con->request.headers, k, klen, CONST_STR_LEN(""));
}
}
@@ -161,28 +161,28 @@ void http_header_request_set(connection *con, enum http_header_e id, const char
*/
if (id > HTTP_HEADER_OTHER)
(vlen) ? (con->request.htags |= id) : (con->request.htags &= ~id);
- array_set_key_value(con->request.headers, k, klen, v, vlen);
+ array_set_key_value(&con->request.headers, k, klen, v, vlen);
}
void http_header_request_append(connection *con, enum http_header_e id, const char *k, size_t klen, const char *v, size_t vlen) {
if (0 == vlen) return;
if (id > HTTP_HEADER_OTHER) con->request.htags |= id;
- buffer * const vb = array_get_buf_ptr(con->request.headers, k, klen);
+ buffer * const vb = array_get_buf_ptr(&con->request.headers, k, klen);
http_header_token_append(vb, v, vlen);
}
buffer * http_header_env_get(connection *con, const char *k, size_t klen) {
- return http_header_generic_get_ifnotempty(con->environment, k, klen);
+ return http_header_generic_get_ifnotempty(&con->environment, k, klen);
}
void http_header_env_set(connection *con, const char *k, size_t klen, const char *v, size_t vlen) {
- array_set_key_value(con->environment, k, klen, v, vlen);
+ array_set_key_value(&con->environment, k, klen, v, vlen);
}
void http_header_env_append(connection *con, const char *k, size_t klen, const char *v, size_t vlen) {
/*if (0 == vlen) return;*//* skip check; permit env var w/ blank value */
- buffer * const vb = array_get_buf_ptr(con->environment, k, klen);
+ buffer * const vb = array_get_buf_ptr(&con->environment, k, klen);
if (0 == vlen) return;
http_header_token_append(vb, v, vlen);
}