]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1922411: Remove server-push from buglist.cgi (#219)
authorDave Miller <justdave@bugzilla.org>
Sat, 11 Jul 2026 04:54:25 +0000 (00:54 -0400)
committerGitHub <noreply@github.com>
Sat, 11 Jul 2026 04:54:25 +0000 (00:54 -0400)
Co-authored-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Portions by justdave r=mrenvoize
Portions by mrenvoize r=justdave

Bugzilla/CGI.pm
Bugzilla/Error.pm
buglist.cgi
skins/standard/global.css
template/en/default/list/server-push.html.tmpl [deleted file]

index a2adf3a5c1843596922ec4977c7e4d13fe6231ba..40a5dc86e4423d0fb75efde433979ed84f4b3954 100644 (file)
@@ -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<multipart_start>
-
-Starts a new part of the multipart document using the specified MIME type.
-If not specified, text/html is assumed.
-
 =item C<close_standby_message>
 
-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<set_dated_content_disp>
 
index 50e53f5e030510a5c53f3b26c7149eab18c7e24e..93aa4b727875ff64b11ebda1f60099bfad5d42ce 100644 (file)
@@ -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);
index 1b92210e6708c22416b4f78dba2389c7cf7a3823..34bfaa8dc630a132b85a6a5b38e74547907829ed 100755 (executable)
@@ -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;
index 20a555c5810e30b03d04125c96e4051413f78c07..d29af6a745607d889c7e2c05702c92db1751fd6e 100644 (file)
@@ -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 (file)
index 65358e6..0000000
+++ /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.
-  #%]
-
-<!DOCTYPE html>
-<html>
-  <head>
-    <title>[% terms.Bugzilla %] is pondering your search</title>
-    <link href="[% 'skins/standard/global.css' FILTER mtime %]"
-          rel="stylesheet" type="text/css">
-  </head>
-  <body>
-    <h1 id="serverpush_msg">Please stand by ...</h1>
-
-    <p class="center">
-      <progress>Data is being retrieved...</progress>
-    </p>
-
-    [% IF debug %]
-      <p>[% query FILTER html %]</p>
-      [% IF query_explain.defined %]
-        <pre>[% query_explain FILTER html %]</pre>
-      [% END %]
-    [% END %]
-  </body>
-</html>