Branch: Tag:

1998-02-22

1998-02-22 19:52:14 by Per Hedbor <ph@opera.com>

Fixed open_file()

Rev: server/base_server/configuration.pike:1.99

1: - string cvs_version = "$Id: configuration.pike,v 1.98 1998/02/20 12:57:18 mirar Exp $"; + string cvs_version = "$Id: configuration.pike,v 1.99 1998/02/22 19:52:14 per Exp $";   #include <module.h>   #include <roxen.h>   
1565:   // this is not as trivial as it sounds. Consider gtext. :-)   public array open_file(string fname, string mode, object id)   { +  werror("open_file "+fname+" as "+mode+"\n");    object oc = id->conf;    string oq = id->not_query;    function funp;
1585:    mode -= "R";    if(f = real_file(fname, id))    { -  werror("open in raw mode.\n"); +  werror("opening "+fname+" in raw mode.\n");    return ({ open(f, mode), ([]) });    } -  + // return ({ 0, (["error":302]) });    }       if(mode=="r")
1604:    {    if(id->misc->error_code)    file = http_low_answer(id->misc->error_code,"Failed" ); -  else if(id->method != "GET" && id->method != "HEAD" && id->method != "POST") +  else if(id->method!="GET"&&id->method != "HEAD"&&id->method!="POST")    file = http_low_answer(501, "Not implemented.");    else    file=http_low_answer(404,replace(parse_rxml(query("ZNoSuchFile"),id),
1619:    {    file->file = StringFile(file->data);    m_delete(file, "data"); -  } else +  }    id->not_query = oq;    return ({ file->file, file });    }