Skip to content

Commit

Permalink
perl: Remove unused module constructor
Browse files Browse the repository at this point in the history
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 3b2c1d0 ("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: #1456
Signed-off-by: Andrew Clayton <[email protected]>
  • Loading branch information
ac000 committed Oct 17, 2024
1 parent 75b7231 commit f6036bb
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/perl/nxt_perl_psgi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 \""
);

Expand Down

0 comments on commit f6036bb

Please sign in to comment.