Bugzilla – Attachment 93541 Details for
Bug 23723
Using exit inside eval to stop sending output to the browser doesn't work under Plack
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23723: using exit inside eval to stop sending output to browser doesn't work under plack
Bug-23723-using-exit-inside-eval-to-stop-sending-o.patch (text/plain), 1.44 KB, created by
Brendan Gallagher
on 2019-10-03 09:37:02 UTC
(
hide
)
Description:
Bug 23723: using exit inside eval to stop sending output to browser doesn't work under plack
Filename:
MIME Type:
Creator:
Brendan Gallagher
Created:
2019-10-03 09:37:02 UTC
Size:
1.44 KB
patch
obsolete
>From 20b9fe582c092f2b6157fee4eb0de8e42672e4be Mon Sep 17 00:00:00 2001 >From: Dobrica Pavlinusic <dpavlin@rot13.org> >Date: Thu, 3 Oct 2019 09:34:17 +0200 >Subject: [PATCH] Bug 23723: using exit inside eval to stop sending output to > browser doesn't work under plack > >When fixing Bug 23589 Theodoros Theodoropoulos noticed that we are sending >headers and html after pdf output to browser. > >Using exit inside eval block doesn't stop plack from generating >headers and html page after exit since CGI::Compile will catch >exit but doesn't stop emiting output. Example is: > >eval { > warn "in eval"; > exit; >}; >warn "after eval"; > >Under CGI, this would print just "in eval", but under plack we get both lines >and thus generate additional header and html after we already sent pdf data. > >Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> >--- > opac/opac-discharge.pl | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >diff --git a/opac/opac-discharge.pl b/opac/opac-discharge.pl >index 4e8381bef8..75b6af8056 100755 >--- a/opac/opac-discharge.pl >+++ b/opac/opac-discharge.pl >@@ -99,11 +99,13 @@ elsif ( $op eq 'get' ) { > my @lines = <$fh>; > close $fh; > print @lines; >- exit; > }; > if ( $@ ) { > carp $@; > $template->param( messages => [ {type => 'error', code => 'unable_to_generate_pdf'} ] ); >+ } else { >+ # no error, pdf is sent, so stop sending data to browser >+ exit; > } > } > else { >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 23723
:
93527
|
93541
|
93551
|
93552
|
93556
|
93580