From f6036bbc7c798133e95d107ef99f289281366b0d Mon Sep 17 00:00:00 2001 From: Andrew Clayton Date: Tue, 15 Oct 2024 19:35:53 +0100 Subject: perl: Remove unused module constructor In the perl language module we create a new perl *module* on the fly comprised of some preamble, the specified perl script and some post-amble. In the preamble we create a constructor called new(), however this can clash with other constructors also called new. While this can be worked around by instead of doing ... new CLASS rather do ... CLASS->new() While this constructor was added in commit 3b2c1d0e ("Perl: added implementation delayed response and streaming body."), I don't see that we actually use it anywhere (nor is it seemingly something we document) and if we simply remove it then things still seem to work, including the Perl pytests ... test/test_perl_application.py::test_perl_streaming_body_multiple_responses[5.38.2] PASSED ... test/test_perl_application.py::test_perl_delayed_response[5.38.2] PASSED test/test_perl_application.py::test_perl_streaming_body[5.38.2] PASSED ... Closes: https://github.com/nginx/unit/issues/1456 Signed-off-by: Andrew Clayton --- src/perl/nxt_perl_psgi.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/perl/nxt_perl_psgi.c b/src/perl/nxt_perl_psgi.c index 271494ac..587656cd 100644 --- a/src/perl/nxt_perl_psgi.c +++ b/src/perl/nxt_perl_psgi.c @@ -409,9 +409,6 @@ nxt_perl_psgi_module_create(const char *script) static const nxt_str_t prefix = nxt_string( "package NGINX::Unit::Sandbox;" - "sub new {" - " return bless {}, $_[0];" - "}" "{my $app = do \"" ); -- cgit