You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rb...@apache.org on 2014/09/03 17:43:27 UTC

svn commit: r1622283 - /httpd/httpd/trunk/docs/manual/rewrite/advanced.xml

Author: rbowen
Date: Wed Sep  3 15:43:27 2014
New Revision: 1622283

URL: http://svn.apache.org/r1622283
Log:
Remove example that doesn't actually work

Modified:
    httpd/httpd/trunk/docs/manual/rewrite/advanced.xml

Modified: httpd/httpd/trunk/docs/manual/rewrite/advanced.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/rewrite/advanced.xml?rev=1622283&r1=1622282&r2=1622283&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/rewrite/advanced.xml (original)
+++ httpd/httpd/trunk/docs/manual/rewrite/advanced.xml Wed Sep  3 15:43:27 2014
@@ -196,165 +196,6 @@ featureful than anything you can cobble 
 
 </section>
 
-<section id="autorefresh">
-
-  <title>Document With Autorefresh</title>
-
-<!--
-I'm trying to decide whether this example is worthwhile to keep, and, if
-so, whether it needs to be updated/rewritten. Certainly the description
-needs to be rewritten. I'm not sure we really need to be recommending
-nph-refresh techniques.
--->
-
-  <dl>
-    <dt>Description:</dt>
-
-    <dd>
-      <p>Wouldn't it be nice, while creating a complex web page, if
-      the web browser would automatically refresh the page every
-      time we save a new version from within our editor?
-      Impossible?</p>
-    </dd>
-
-    <dt>Solution:</dt>
-
-    <dd>
-      <p>No! We just combine the MIME multipart feature, the
-      web server NPH feature, and the URL manipulation power of
-      <module>mod_rewrite</module>. First, we establish a new
-      URL feature: Adding just <code>:refresh</code> to any
-      URL causes the 'page' to be refreshed every time it is
-      updated on the filesystem.</p>
-
-<highlight language="config">
-RewriteRule   ^(/[uge]/[^/]+/?.*):refresh  /internal/cgi/apache/nph-refresh?f=$1
-</highlight>
-
-      <p>Now when we reference the URL</p>
-
-<example>
-/u/foo/bar/page.html:refresh
-</example>
-
-      <p>this leads to the internal invocation of the URL</p>
-
-<example>
-/internal/cgi/apache/nph-refresh?f=/u/foo/bar/page.html
-</example>
-
-      <p>The only missing part is the NPH-CGI script. Although
-      one would usually say "left as an exercise to the reader"
-      ;-) I will provide this, too.</p>
-
-<highlight language="perl">
-#!/sw/bin/perl
-##
-##  nph-refresh -- NPH/CGI script for auto refreshing pages
-##  Copyright (c) 1997 Ralf S. Engelschall, All Rights Reserved.
-##
-$| = 1;
-
-#   split the QUERY_STRING variable
-@pairs = split( /&amp;/, $ENV{'QUERY_STRING'} );
-foreach $pair (@pairs) {
-    ( $name, $value ) = split( /=/, $pair );
-    $name =~ tr/A-Z/a-z/;
-    $name = 'QS_' . $name;
-    $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
-    eval "\$$name = \"$value\"";
-}
-$QS_s = 1    if ( $QS_s eq '' );
-$QS_n = 3600 if ( $QS_n eq '' );
-if ( $QS_f eq '' ) {
-    print "HTTP/1.0 200 OK\n";
-    print "Content-type: text/html\n\n";
-    print "&lt;b&gt;ERROR&lt;/b&gt;: No file given\n";
-    exit(0);
-}
-if ( !-f $QS_f ) {
-    print "HTTP/1.0 200 OK\n";
-    print "Content-type: text/html\n\n";
-    print "&lt;b&gt;ERROR&lt;/b&gt;: File $QS_f not found\n";
-    exit(0);
-}
-
-sub print_http_headers_multipart_begin {
-    print "HTTP/1.0 200 OK\n";
-    $bound = "ThisRandomString12345";
-    print "Content-type: multipart/x-mixed-replace;boundary=$bound\n";
-    &amp;print_http_headers_multipart_next;
-}
-
-sub print_http_headers_multipart_next {
-    print "\n--$bound\n";
-}
-
-sub print_http_headers_multipart_end {
-    print "\n--$bound--\n";
-}
-
-sub displayhtml {
-    local ($buffer) = @_;
-    $len = length($buffer);
-    print "Content-type: text/html\n";
-    print "Content-length: $len\n\n";
-    print $buffer;
-}
-
-sub readfile {
-    local ($file) = @_;
-    local ( *FP, $size, $buffer, $bytes );
-    ( $x, $x, $x, $x, $x, $x, $x, $size ) = stat($file);
-    $size = sprintf( "%d", $size );
-    open( FP, "&lt;$file" );
-    $bytes = sysread( FP, $buffer, $size );
-    close(FP);
-    return $buffer;
-}
-
-$buffer = &amp;readfile($QS_f);
-&amp;print_http_headers_multipart_begin;
-&amp;displayhtml($buffer);
-
-sub mystat {
-    local ($file) = $_[0];
-    local ($time);
-
-    ( $x, $x, $x, $x, $x, $x, $x, $x, $x, $mtime ) = stat($file);
-    return $mtime;
-}
-
-$mtimeL = &amp;mystat($QS_f);
-$mtime  = $mtime;
-for ( $n = 0 ; $n &amp; lt ; $QS_n ; $n++ ) {
-    while (1) {
-        $mtime = &amp;mystat($QS_f);
-        if ( $mtime ne $mtimeL ) {
-            $mtimeL = $mtime;
-            sleep(2);
-            $buffer = &amp;readfile($QS_f);
-            &amp;print_http_headers_multipart_next;
-            &amp;displayhtml($buffer);
-            sleep(5);
-            $mtimeL = &amp;mystat($QS_f);
-            last;
-        }
-        sleep($QS_s);
-    }
-}
-
-&amp;print_http_headers_multipart_end;
-
-exit(0);
-
-##EOF##
-</highlight>
-    </dd>
-  </dl>
-
-</section>
-
 <section id="structuredhomedirs">
 
   <title>Structured Userdirs</title>