Roxen.git / server / modules / filesystems / filesystem.pike

version» Context lines:

Roxen.git/server/modules/filesystems/filesystem.pike:1:   // This is a roxen module. Copyright © 1996 - 1998, Idonex AB.      // This is a virtual "file-system".   // It will be located somewhere in the name-space of the server.   // Also inherited by some of the other filesystems.      inherit "module";   inherit "roxenlib";   inherit "socket";    - constant cvs_version= "$Id: filesystem.pike,v 1.45 1998/08/25 20:03:36 neotron Exp $"; + constant cvs_version= "$Id: filesystem.pike,v 1.46 1998/08/26 11:31:03 grubba Exp $";   constant thread_safe=1;         #include <module.h>   #include <roxen.h>   #include <stat.h>      #if DEBUG_LEVEL > 20   # ifndef FILESYSTEM_DEBUG   # define FILESYSTEM_DEBUG
Roxen.git/server/modules/filesystems/filesystem.pike:305: Inside #if defined(FILESYSTEM_DEBUG)
  #ifdef FILESYSTEM_DEBUG    roxen_perror("FILESYSTEM: Request for \""+f+"\"\n");   #endif /* FILESYSTEM_DEBUG */       f = path + f;   #ifdef __NT__    if(f[-1]=='/') f = f[..strlen(f)-2];   #endif    size = FILE_SIZE( f );    +  /* +  * FIXME: Should probably move path-info extraction here. +  * /grubba 1998-08-26 +  */ +     switch(id->method)    {    case "GET":    case "HEAD":    case "POST":       switch(-size)    {    case 1:    case 3:
Roxen.git/server/modules/filesystems/filesystem.pike:326:    TRACE_LEAVE("No file");    return 0; /* Is no-file */       case 2:    TRACE_LEAVE("Is directory");    return -1; /* Is dir */       default:    if(f[ -1 ] == '/') /* Trying to access file with '/' appended */    { -  /* Neotron was here. I change this to always return 0 as CGI scripts -  with path info = / won't work otherwise. If someone accesses a file -  with "/" appended, a 404 no such file isn't that weird. Both -  Apache and Netscape returns the accessed page, resulting in -  incorrect links from that page. */ +  /* Neotron was here. I changed this to always return 0 since +  * CGI-scripts with path info = / won't work otherwise. If +  * someone accesses a file with "/" appended, a 404 no such +  * file isn't that weird. Both Apache and Netscape return the +  * accessed page, resulting in incorrect links from that page. +  * +  * FIXME: The proper way to do this would probably be to set path info +  * here, and have the redirect be done by the extension modules, +  * or by the protocol module if there isn't any extension module. +  * /grubba 1998-08-26 +  */    return 0;    /* Do not try redirect on top level directory */    if(sizeof(id->not_query) < 2)    return 0;    redirects++;    TRACE_LEAVE("Redirecting to \"" +    id->not_query[..sizeof(id->not_query)-2] +    "\"");    return http_redirect(id->not_query[..sizeof(id->not_query)-2], id);    }