File: backport_1.08-fix-startup.patch

package info (click to toggle)
libapache-dbi-perl 1.07-1%2Blenny2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 192 kB
  • ctags: 39
  • sloc: perl: 1,095; makefile: 43
file content (17 lines) | stat: -rw-r--r-- 746 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Description: backport fix for loading from startup.pl from 1.08
# Origin: upstream, http://search.cpan.org/diff?from=Apache-DBI-1.07&to=Apache-DBI-1.08
# Bug: https://rt.cpan.org/Public/Bug/Display.html?id=36346
# Bug-Debian: http://bugs.debian.org/568534
--- a/lib/Apache/DBI.pm
+++ b/lib/Apache/DBI.pm
@@ -141,7 +141,9 @@ sub connect {
     if (!$Rollback{$Idx}) {
         my $r;
         if (MP2) {
-            $r = Apache2::RequestUtil->request;
+            # We may not actually be in a request, but in <Perl> (or
+            # equivalent such as startup.pl), in which case this would die.
+            eval { $r = Apache2::RequestUtil->request };
         }
         elsif (Apache->can('push_handlers')) {
             $r = 'Apache';