summaryrefslogtreecommitdiff
path: root/src/mod_proxy.c
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2022-05-03 01:10:10 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2022-05-11 23:51:47 -0400
commitf2610d23e242e96b49b115081c094206cca3e00d (patch)
tree5a91643123b35c77d37beab2debc24a477ffd275 /src/mod_proxy.c
parent1194e6d24b92d1bdac60eb07ef45ad726d479654 (diff)
downloadlighttpd-git-f2610d23e242e96b49b115081c094206cca3e00d.tar.gz
[multiple] use buffer_append_char()
Diffstat (limited to 'src/mod_proxy.c')
-rw-r--r--src/mod_proxy.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/mod_proxy.c b/src/mod_proxy.c
index 2e3d4df6..26a0eced 100644
--- a/src/mod_proxy.c
+++ b/src/mod_proxy.c
@@ -506,7 +506,7 @@ static void http_header_remap_uri (buffer *b, size_t off, http_header_remap_opts
else {
alen = buffer_clen(b) - off;
if (0 == alen) return; /*(empty authority, e.g. "http:///")*/
- buffer_append_string_len(b, CONST_STR_LEN("/"));
+ buffer_append_char(b, '/');
}
/* remap authority (if configured) and set offset to url-path */
@@ -669,11 +669,11 @@ static void proxy_set_Forwarded(connection * const con, request_st * const r, co
int ipv6 = (NULL != strchr(efor->ptr, ':'));
ipv6
? buffer_append_string_len(b, CONST_STR_LEN("\"["))
- : buffer_append_string_len(b, CONST_STR_LEN("\""));
+ : buffer_append_char(b, '"');
buffer_append_string_backslash_escaped(b, BUF_PTR_LEN(efor));
ipv6
? buffer_append_string_len(b, CONST_STR_LEN("]\""))
- : buffer_append_string_len(b, CONST_STR_LEN("\""));
+ : buffer_append_char(b, '"');
} else if (family == AF_INET) {
/*(Note: if :port is added, then must be quoted-string:
* e.g. for="...:port")*/
@@ -683,10 +683,10 @@ static void proxy_set_Forwarded(connection * const con, request_st * const r, co
BUF_PTR_LEN(&con->dst_addr_buf),
CONST_STR_LEN("]\""));
} else {
- buffer_append_string_len(b, CONST_STR_LEN("\""));
+ buffer_append_char(b, '"');
buffer_append_string_backslash_escaped(
b, BUF_PTR_LEN(&con->dst_addr_buf));
- buffer_append_string_len(b, CONST_STR_LEN("\""));
+ buffer_append_char(b, '"');
}
semicolon = 1;
}
@@ -699,7 +699,7 @@ static void proxy_set_Forwarded(connection * const con, request_st * const r, co
* INADDR_ANY or in6addr_any, but must omit optional :port
* from con->srv_socket->srv_token for consistency */
- if (semicolon) buffer_append_string_len(b, CONST_STR_LEN(";"));
+ if (semicolon) buffer_append_char(b, ';');
buffer_append_string_len(b, CONST_STR_LEN("by=\""));
#ifdef HAVE_SYS_UN_H
/* special-case: might need to encode unix domain socket path */
@@ -716,7 +716,7 @@ static void proxy_set_Forwarded(connection * const con, request_st * const r, co
sock_addr_stringify_append_buffer(b, &addr);
}
}
- buffer_append_string_len(b, CONST_STR_LEN("\""));
+ buffer_append_char(b, '"');
semicolon = 1;
}
@@ -726,7 +726,7 @@ static void proxy_set_Forwarded(connection * const con, request_st * const r, co
: NULL;
/* expecting "http" or "https"
* (not checking if quoted-string and encoding needed) */
- if (semicolon) buffer_append_string_len(b, CONST_STR_LEN(";"));
+ if (semicolon) buffer_append_char(b, ';');
if (NULL != eproto) {
buffer_append_str2(b, CONST_STR_LEN("proto="), BUF_PTR_LEN(eproto));
} else if (con->srv_socket->is_ssl) {
@@ -743,19 +743,19 @@ static void proxy_set_Forwarded(connection * const con, request_st * const r, co
: NULL;
if (NULL != ehost) {
if (semicolon)
- buffer_append_string_len(b, CONST_STR_LEN(";"));
+ buffer_append_char(b, ';');
buffer_append_string_len(b, CONST_STR_LEN("host=\""));
buffer_append_string_backslash_escaped(
b, BUF_PTR_LEN(ehost));
- buffer_append_string_len(b, CONST_STR_LEN("\""));
+ buffer_append_char(b, '"');
semicolon = 1;
} else if (r->http_host && !buffer_is_blank(r->http_host)) {
if (semicolon)
- buffer_append_string_len(b, CONST_STR_LEN(";"));
+ buffer_append_char(b, ';');
buffer_append_string_len(b, CONST_STR_LEN("host=\""));
buffer_append_string_backslash_escaped(
b, BUF_PTR_LEN(r->http_host));
- buffer_append_string_len(b, CONST_STR_LEN("\""));
+ buffer_append_char(b, '"');
semicolon = 1;
}
}
@@ -765,11 +765,11 @@ static void proxy_set_Forwarded(connection * const con, request_st * const r, co
http_header_env_get(r, CONST_STR_LEN("REMOTE_USER"));
if (NULL != remote_user) {
if (semicolon)
- buffer_append_string_len(b, CONST_STR_LEN(";"));
+ buffer_append_char(b, ';');
buffer_append_string_len(b, CONST_STR_LEN("remote_user=\""));
buffer_append_string_backslash_escaped(
b, BUF_PTR_LEN(remote_user));
- buffer_append_string_len(b, CONST_STR_LEN("\""));
+ buffer_append_char(b, '"');
/*semicolon = 1;*/
}
}