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

version» Context lines:

Roxen.git/server/modules/filesystems/filesystem.pike:1:   // This is a ChiliMoon module. Copyright © 1996 - 2001, Roxen IS.      // 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 "socket";    - constant cvs_version = "$Id: filesystem.pike,v 1.126 2004/05/31 23:01:51 _cvs_stephen Exp $"; + constant cvs_version = "$Id: filesystem.pike,v 1.127 2004/06/04 08:29:20 _cvs_stephen Exp $";   constant thread_safe = 1;      #include <module.h>   #include <stat.h>   #include <request_trace.h>   #include <roxen.h>      // NGSERVER: Make an API where a module can send back an error token which is   // then substituted with the apropriate message for the protocol and locale.   // This would enable us to theme other error pages than the now special case 404.
Roxen.git/server/modules/filesystems/filesystem.pike:352:   }      string decode_path( string p )   {    if( path_encoding != "iso-8859-1" )    p = Locale.Charset.encoder( path_encoding )->feed( p )->drain();   #ifndef __NT__    if( String.width( p ) != 8 )    p = string_to_utf8( p );   #else -  while( strlen(p) && p[-1] == '/' ) +  while( sizeof(p) && p[-1] == '/' )    p = p[..strlen(p)-2];   #endif    return p;   }      string real_path(string f, RequestID id)   {    f = path + f;    if (FILTER_INTERNAL_FILE(f, id)) return 0;    catch {
Roxen.git/server/modules/filesystems/filesystem.pike:583:    "Bad Request - "    "Expected more data."));    } else {    id->send_result(Roxen.http_status((size < 0)?201:200,    "Transfer Complete."));    }   }      void got_put_data( array(object|string|int) id_arr, string data )   { - // werror(strlen(data)+" .. "); + // werror(sizeof(data)+" .. ");       object to;    object from;    object id;    string oldf;    int size;       [to, from, id, oldf, size] = id_arr;       // Truncate at end.
Roxen.git/server/modules/filesystems/filesystem.pike:1043:    if(!to)    {    TRACE_LEAVE("PUT: Open failed");    return errno_to_status (err, 1, id);    }       // FIXME: Race-condition.    chmod(f, 0666 & ~(id->misc->umask || 022));       putting[id->my_fd] = id->misc->len; -  if(id->data && strlen(id->data)) +  if(id->data && sizeof(id->data))    {    // FIXME: What if sizeof(id->data) > id->misc->len ?    if (id->misc->len > 0) { -  putting[id->my_fd] -= strlen(id->data); +  putting[id->my_fd] -= sizeof(id->data);    }    int bytes = to->write( id->data );    if (id->misc->quota_obj) {    QUOTA_WERR("Allocating " + bytes + "bytes.");    if (!id->misc->quota_obj->allocate(f, bytes)) {    TRACE_LEAVE("PUT: A string");    TRACE_LEAVE("PUT: Out of quota");    return Roxen.http_status(507, "Out of disk quota.");    }    }