Skip to content

Commit

Permalink
cgi/Launch: use PreparedChildProcess::PutEnv() to reduce allocations
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKellermann committed Jul 24, 2024
1 parent daa3576 commit e319e17
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/cgi/Launch.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ PrepareCgi(struct pool &pool, PreparedChildProcess &p,
{
const char *path = address.path;

p.SetEnv("GATEWAY_INTERFACE", "CGI/1.1");
p.SetEnv("SERVER_PROTOCOL", "HTTP/1.1");
p.PutEnv("GATEWAY_INTERFACE=CGI/1.1");
p.PutEnv("SERVER_PROTOCOL=HTTP/1.1");
p.SetEnv("REQUEST_METHOD", http_method_to_string(method));
p.SetEnv("SCRIPT_FILENAME", path);
p.SetEnv("PATH_TRANSLATED", path);
Expand Down Expand Up @@ -122,7 +122,7 @@ PrepareCgi(struct pool &pool, PreparedChildProcess &p,

const char *https = headers.Get(x_cm4all_https_header);
if (https != nullptr && strcmp(https, "on") == 0)
p.SetEnv("HTTPS", "on");
p.PutEnv("HTTPS=on");

p.Append(path);
for (auto i : address.args)
Expand Down

0 comments on commit e319e17

Please sign in to comment.