From: Dave Miller Date: Sat, 11 Jul 2026 04:54:25 +0000 (-0400) Subject: Bug 1922411: Remove server-push from buglist.cgi (#219) X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=832c348ecbca6894c85e623d4a14fcaa3d367603;p=thirdparty%2Fbugzilla.git Bug 1922411: Remove server-push from buglist.cgi (#219) Co-authored-by: Martin Renvoize Portions by justdave r=mrenvoize Portions by mrenvoize r=justdave --- diff --git a/Bugzilla/CGI.pm b/Bugzilla/CGI.pm index a2adf3a5c1..40a5dc86e4 100644 --- a/Bugzilla/CGI.pm +++ b/Bugzilla/CGI.pm @@ -292,38 +292,10 @@ sub check_etag { return 0; } -# Have to add the cookies in. -sub multipart_start { - my $self = shift; - - # We have to explicitly pass the charset. - my $headers = $self->SUPER::multipart_start(@_, -charset => $self->charset()); - - # Eliminate the one extra CRLF at the end. - $headers =~ s/$CGI::CRLF$//; - - # Add the cookies. We have to do it this way instead of - # passing them to multipart_start, because CGI.pm's multipart_start - # doesn't understand a '-cookie' argument pointing to an arrayref. - foreach my $cookie (@{$self->{Bugzilla_cookie_list}}) { - $headers .= "Set-Cookie: ${cookie}${CGI::CRLF}"; - } - $headers .= $CGI::CRLF; - $self->{_multipart_in_progress} = 1; - return $headers; -} - sub close_standby_message { my ($self, $contenttype, $disp, $disp_prefix, $extension) = @_; $self->set_dated_content_disp($disp, $disp_prefix, $extension); - - if ($self->{_multipart_in_progress}) { - print $self->multipart_end(); - print $self->multipart_start(-type => $contenttype); - } - elsif (!$self->{_header_done}) { - print $self->header($contenttype); - } + print $self->header($contenttype) if !$self->{_header_done}; } our $ALLOW_UNSAFE_RESPONSE = 0; @@ -819,14 +791,10 @@ instead of calling this directly. Redirects from the current URL to one prefixed by the urlbase parameter. -=item C - -Starts a new part of the multipart document using the specified MIME type. -If not specified, text/html is assumed. - =item C -Ends a part of the multipart document, and starts another part. +Sets the content disposition header and sends the response header if it has +not already been sent. =item C diff --git a/Bugzilla/Error.pm b/Bugzilla/Error.pm index 50e53f5e03..93aa4b7278 100644 --- a/Bugzilla/Error.pm +++ b/Bugzilla/Error.pm @@ -96,7 +96,6 @@ sub _throw_error { my $cgi = Bugzilla->cgi; $cgi->close_standby_message('text/html', 'inline', 'error', 'html'); print $message; - print $cgi->multipart_final() if $cgi->{_multipart_in_progress}; } elsif (Bugzilla->error_mode == ERROR_MODE_TEST) { die Dumper($vars); diff --git a/buglist.cgi b/buglist.cgi index 1b92210e67..34bfaa8dc6 100755 --- a/buglist.cgi +++ b/buglist.cgi @@ -471,23 +471,6 @@ my $format = $template->get_format( scalar $params->param('ctype') ); -# Use server push to display a "Please wait..." message for the user while -# executing their query if their browser supports it and they are viewing -# the bug list as HTML and they have not disabled it by adding &serverpush=0 -# to the URL. -# -# Server push is compatible with Gecko-based browsers and Opera, but not with -# MSIE, Lynx or Safari (bug 441496). - -my $serverpush - = $format->{'extension'} eq "html" - && exists $ENV{'HTTP_USER_AGENT'} - && $ENV{'HTTP_USER_AGENT'} =~ /(Mozilla.[3-9]|Opera)/ - && $ENV{'HTTP_USER_AGENT'} !~ /compatible/i - && $ENV{'HTTP_USER_AGENT'} !~ /(?:WebKit|Trident|KHTML)/ - && !defined($cgi->param('serverpush')) || $cgi->param('serverpush'); - - # Generate a reasonable filename for the user agent to suggest to the user # when the user saves the bug list. Uses the name of the remembered query # if available. We have to do this now, even though we return HTTP headers @@ -718,27 +701,6 @@ $params->delete('limit') if $vars->{'default_limited'}; # Query Execution ################################################################################ -# Time to use server push to display an interim message to the user until -# the query completes and we can display the bug list. -if ($serverpush) { - print $cgi->multipart_init(); - print $cgi->multipart_start(-type => 'text/html'); - - # Generate and return the UI (HTML page) from the appropriate template. - $template->process("list/server-push.html.tmpl", $vars) - || ThrowTemplateError($template->error()); - - # Under mod_perl, flush stdout so that the page actually shows up. - if ($ENV{MOD_PERL}) { - require Apache2::RequestUtil; - Apache2::RequestUtil->request->rflush(); - } - - # Don't do multipart_end() until we're ready to display the replacement - # page, otherwise any errors that happen before then (like SQL errors) - # will result in a blank page being shown to the user instead of the error. -} - # Connect to the shadow database if this installation is using one to improve # query performance. $dbh = Bugzilla->switch_to_shadow_db(); @@ -1156,5 +1118,3 @@ $template->process($format->{'template'}, $vars) ################################################################################ # Script Conclusion ################################################################################ - -print $cgi->multipart_final() if $serverpush; diff --git a/skins/standard/global.css b/skins/standard/global.css index 20a555c581..d29af6a745 100644 --- a/skins/standard/global.css +++ b/skins/standard/global.css @@ -926,12 +926,6 @@ div.user_match { display: none; } -#serverpush_msg { - margin-top: 20%; - text-align: center; - font-size: xx-large; -} - /* Rules specific for printing */ @media print { #header, #footer { diff --git a/template/en/default/list/server-push.html.tmpl b/template/en/default/list/server-push.html.tmpl deleted file mode 100644 index 65358e6cdd..0000000000 --- a/template/en/default/list/server-push.html.tmpl +++ /dev/null @@ -1,35 +0,0 @@ -[%# This Source Code Form is subject to the terms of the Mozilla Public - # License, v. 2.0. If a copy of the MPL was not distributed with this - # file, You can obtain one at http://mozilla.org/MPL/2.0/. - # - # This Source Code Form is "Incompatible With Secondary Licenses", as - # defined by the Mozilla Public License, v. 2.0. - #%] - -[%# INTERFACE: - # debug: boolean. True if we want the search displayed while we wait. - # query: string. The SQL query which makes the buglist. - #%] - - - - - [% terms.Bugzilla %] is pondering your search - - - -

Please stand by ...

- -

- Data is being retrieved... -

- - [% IF debug %] -

[% query FILTER html %]

- [% IF query_explain.defined %] -
[% query_explain FILTER html %]
- [% END %] - [% END %] - -