[interchange-cvs] interchange - jon modified dist/src/mod_perl2/Interchange/Link.pm

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Fri Nov 16 10:18:43 EST 2007


User:      jon
Date:      2007-11-16 15:18:43 GMT
Modified:  dist/src/mod_perl2/Interchange Link.pm
Log:
Improvements to Interchange::Link:

Return an HTTP 404 response code when appropriate.

Avoid segmentation faults on broken pipe.

Patch supplied by Grant <emailgrant at gmail.com>. Thanks!

Revision  Changes    Path
1.14      +4 -29     interchange/dist/src/mod_perl2/Interchange/Link.pm


rev 1.14, prev_rev 1.13
Index: Link.pm
===================================================================
RCS file: /var/cvs/interchange/dist/src/mod_perl2/Interchange/Link.pm,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -u -r1.13 -r1.14
--- Link.pm	9 Aug 2007 13:40:52 -0000	1.13
+++ Link.pm	16 Nov 2007 15:18:43 -0000	1.14
@@ -2,7 +2,7 @@
 
 # Interchange::Link -- mod_perl 1.99/2.0 module for linking to Interchange
 #
-# $Id: Link.pm,v 1.13 2007/08/09 13:40:52 pajamian Exp $
+# $Id: Link.pm,v 1.14 2007/11/16 15:18:43 jon Exp $
 #
 # Copyright (C) 2002-2007 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -27,7 +27,6 @@
 use strict;
 use ModPerl::Registry;
 use ModPerl::Code;
-#use Apache::Const;
 use Apache2::Const -compile => qw(DECLINED OK NOT_FOUND FORBIDDEN REDIRECT HTTP_MOVED_PERMANENTLY);
 use Apache2::ServerRec ();
 require Apache2::Connection;
@@ -48,7 +47,7 @@
 
 =head1 VERSION
 
-$Revision: 1.13 $
+$Revision: 1.14 $
 
 =head1 SYNOPSIS
 
@@ -413,30 +412,6 @@
 my $ent;
 
 
-# Return this message to the browser when the server is not running.
-# Log an error log entry if set to notify
-
-sub die_page {
-
-    my $r = shift;
-    my $msg;
-
-    warn "ALERT: bad pipe signal received for $ENV{SCRIPT_NAME}\n";   
-
-    $r->content_type ("text/html");
-    $r->print (<<EOF);
-<html><head><title>Interrupted</title></head>
-<body bgcolor="#FFFFFF">
-<h3>Someone pressed stop...</h3>
-<p>
-We have aborted this request because someone terminated it.
-Please try again soon.
-</p>
-</body></html>
-EOF
-
-}
-
 sub server_not_running {
 
     my $r = shift;
@@ -622,7 +597,7 @@
 
     my $cfg = setup_location($r);
 
-    $SIG{PIPE} = sub { die_page($r); };
+    $SIG{PIPE} = 'IGNORE';
     $SIG{ALRM} = sub { server_not_running($r); exit 1; };
 
     my ($remote, $port, $iaddr, $paddr, $proto, $line);
@@ -747,7 +722,7 @@
         elsif($set_status =~ /^404/) {
 #warn "404 not found status\n";
             close (SOCK)                                or die "close: $!\n";
-            return Apache2::Const::OK;
+            return Apache2::Const::NOT_FOUND;
         }
 		elsif($set_status eq 'httpd_deliver') {
 			$deliver_object = $set_status;








More information about the interchange-cvs mailing list