Browse Source

[core] (const connection *) in http_header_*_get()

personal/stbuehler/ci-build
Glenn Strauss 2 years ago
parent
commit
88ac4367f0
  1. 6
      src/http_header.c
  2. 6
      src/http_header.h

6
src/http_header.c

@ -97,7 +97,7 @@ 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) {
buffer * http_header_response_get(const 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)
: NULL;
@ -140,7 +140,7 @@ 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) {
buffer * http_header_request_get(const 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)
: NULL;
@ -171,7 +171,7 @@ void http_header_request_append(connection *con, enum http_header_e id, const ch
}
buffer * http_header_env_get(connection *con, const char *k, size_t klen) {
buffer * http_header_env_get(const connection *con, const char *k, size_t klen) {
return http_header_generic_get_ifnotempty(&con->environment, k, klen);
}

6
src/http_header.h

@ -47,20 +47,20 @@ __attribute_pure__
int http_header_str_contains_token (const char *s, size_t slen, const char *m, size_t mlen);
__attribute_pure__
buffer * http_header_response_get(connection *con, enum http_header_e id, const char *k, size_t klen);
buffer * http_header_response_get(const connection *con, enum http_header_e id, const char *k, size_t klen);
void http_header_response_unset(connection *con, enum http_header_e id, const char *k, size_t klen);
void http_header_response_set(connection *con, enum http_header_e id, const char *k, size_t klen, const char *v, size_t 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);
void http_header_response_insert(connection *con, enum http_header_e id, const char *k, size_t klen, const char *v, size_t vlen);
__attribute_pure__
buffer * http_header_request_get(connection *con, enum http_header_e id, const char *k, size_t klen);
buffer * http_header_request_get(const connection *con, enum http_header_e id, const char *k, size_t klen);
void http_header_request_unset(connection *con, enum http_header_e id, const char *k, size_t klen);
void http_header_request_set(connection *con, enum http_header_e id, const char *k, size_t klen, const char *v, size_t 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);
__attribute_pure__
buffer * http_header_env_get(connection *con, const char *k, size_t klen);
buffer * http_header_env_get(const connection *con, const char *k, size_t klen);
void http_header_env_set(connection *con, const char *k, size_t klen, const char *v, size_t vlen);
void http_header_env_append(connection *con, const char *k, size_t klen, const char *v, size_t vlen);

Loading…
Cancel
Save