[ic] Interchange::Link changes - submitted for your approval

Grant emailgrant at gmail.com
Sat Aug 22 00:42:24 UTC 2009


I've made a couple changes to the Interchange::Link module which I
think have general applicability.  I've added a config option which
removes all blank lines from the HTML output and changed the "IC is
not running" message to be a little more user-friendly, although not
as useful for debugging.  I've left the debugging variables in, just
commented.  The patch is very simple.

- Grant
-------------- next part --------------
@@ -315,6 +315,11 @@ files from being served directly by Apac
 under a directory at the Interchange location, or you can use normal
 Apache exclusions.
 
+=item NoBlankLines
+
+Set C<NoBlankLines> to 1 to remove blank lines from the outputted source
+code.
+
 =back
 
 =head1 BUGS
@@ -421,21 +426,15 @@ sub server_not_running {
 
     $r->content_type ("text/html");
     $r->print (<<EOF);
-<html><head><title>Interchange server not running</title></head>
-<body bgcolor="#FFFFFF">
-<h3>We're sorry, the Interchange server was not running...</h3>
-<p>
-We are out of service or may be experiencing high system demand.
-Please try again soon.
-</p>
-<h3>This is it:</h3>
-<pre>
-$arg
-$env
-$ent
-</pre>
+<html><body>
+<p>We are temporarily out of service or may be experiencing high system demand.
+Please try again soon.</p>
 </body></html>
 EOF
+# use for debugging:
+#$arg
+#$env
+#$ent
 
 }
 
@@ -764,7 +763,12 @@ sub handler {
 
 		$r->content_type($set_content);
 		while( <SOCK> ) {
-			push @out, $_;
+            		if($r->dir_config('NoBlankLines')) {
+				push @out, $_ if /\S/;
+			}
+			else {
+				push @out, $_;
+			}
 		}
 		close (SOCK)                                or die "close: $!\n";
 		print @out;


More information about the interchange-users mailing list