httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Hartill <hart...@ooo.lanl.gov>
Subject redirection patch
Date Fri, 10 Mar 1995 10:54:08 GMT

I was just looking at my patch for "302" redirects - what it
doesn't do is add a body to the header to say

 "This URL has moved to <A HREF="...">somewhere else</A>

on behalf of dumb clients.

I suspect this is why Rob McCool decided to thump all
redirects and treat them special with a die(REDIRECT).

Decission time - should redirect scripts be responsible for their
own body, and choose to add or omit one, and have the server leave
it all up to the script, or

should httpd add a body if there isn't one - as it does now, but
overwrite any body produced by the script, or

should httpd look for a body, add one if there isn't one.

The last option sounds the most reasonable, but will need some
additional coding.

I think we'd need to change "send_fd" from being a void function
to one returning the number of bytes (long) sent. If it returns
0, then we send the redirect blurb...


so  in 
  http_script.c  cgi_stub() & exec_post_NCSA()  exec_get_NCSA() 
the line

       send_fd(?,??,kill_children);

would change to

       if (!send_fd(?,??,kill_children) && location[0] == '/') {
           title_html(??,"Document moved");
           fprintf(??,"This document has moved <A HREF=\"%s\">here</A>.<P>%c",err_string,LF);
       }
         

Does anyone see any problem with that ?

rob h

Mime
View raw message