mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 06:11:32 +02:00
CLEANUP: fcgi: Replace memcpy() on ist by istcat()
This is a little cleaner, because the length of the resulting string does not need to be calculated manually.
This commit is contained in:
parent
b4b03779d0
commit
98f05f6a38
@ -2030,6 +2030,8 @@ static size_t fcgi_strm_send_params(struct fcgi_conn *fconn, struct fcgi_strm *f
|
|||||||
else if (isteq(p.n, ist("content-type")))
|
else if (isteq(p.n, ist("content-type")))
|
||||||
p.n = ist("CONTENT_TYPE");
|
p.n = ist("CONTENT_TYPE");
|
||||||
else {
|
else {
|
||||||
|
struct ist n;
|
||||||
|
|
||||||
if (isteq(p.n, ist("host")))
|
if (isteq(p.n, ist("host")))
|
||||||
params.srv_name = p.v;
|
params.srv_name = p.v;
|
||||||
else if (isteq(p.n, ist("te"))) {
|
else if (isteq(p.n, ist("te"))) {
|
||||||
@ -2046,9 +2048,10 @@ static size_t fcgi_strm_send_params(struct fcgi_conn *fconn, struct fcgi_strm *f
|
|||||||
if (isttest(fconn->proxy->server_id_hdr_name) && isteq(p.n, fconn->proxy->server_id_hdr_name))
|
if (isttest(fconn->proxy->server_id_hdr_name) && isteq(p.n, fconn->proxy->server_id_hdr_name))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
memcpy(trash.area, "http_", 5);
|
n = ist2(trash.area, 0);
|
||||||
memcpy(trash.area+5, p.n.ptr, p.n.len);
|
istcat(&n, ist("http_"), trash.size);
|
||||||
p.n = ist2(trash.area, p.n.len+5);
|
istcat(&n, p.n, trash.size);
|
||||||
|
p.n = n;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fcgi_encode_param(&outbuf, &p)) {
|
if (!fcgi_encode_param(&outbuf, &p)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user