From e319e170cf9ddbd95024b4c7273c5db1829286a5 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 24 Jul 2024 21:48:40 +0200 Subject: [PATCH] cgi/Launch: use PreparedChildProcess::PutEnv() to reduce allocations --- src/cgi/Launch.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cgi/Launch.cxx b/src/cgi/Launch.cxx index 512336ca8..dfcae763e 100644 --- a/src/cgi/Launch.cxx +++ b/src/cgi/Launch.cxx @@ -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); @@ -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)