]> Sergey Matveev's repositories - public-inbox.git/commitdiff
githttpbackend: use REMOTE_ADDR for deleted identifier
authorEric Wong <e@80x24.org>
Thu, 12 Sep 2019 23:16:52 +0000 (23:16 +0000)
committerEric Wong <e@80x24.org>
Sat, 14 Sep 2019 09:24:38 +0000 (09:24 +0000)
REMOTE_HOST is not set by us (it is the reverse DNS name) of
REMOTE_ADDR, and there's few better ways to kill HTTP server
performance than to use standard name resolution APIs like
getnameinfo(3).

lib/PublicInbox/GitHTTPBackend.pm

index a8337035f207b75ffec2e3fe024def52d1399d1b..c9a7cff88cc419bc71241006511d42ac7b4ec4d5 100644 (file)
@@ -219,7 +219,7 @@ sub input_prepare {
        if (defined $fd && $fd >= 0) {
                return { 0 => $fd };
        }
-       my $id = "git-http.input.$env->{REMOTE_HOST}:$env->{REMOTE_PORT}";
+       my $id = "git-http.input.$env->{REMOTE_ADDR}:$env->{REMOTE_PORT}";
        my $in = tmpfile($id);
        unless (defined $in) {
                err($env, "could not open temporary file: $!");