Branch: Tag:

1998-03-28

1998-03-28 01:25:01 by David Hedbor <david@hedbor.org>

hosts.pike: fixed a "indexing on basic type". http.pike: fixed some problems
in the backtrace generation and added a "catch" to it.

Rev: server/base_server/hosts.pike:1.24
Rev: server/protocols/http.pike:1.77

1:   // This is a roxen module. Copyright © 1996 - 1998, Idonex AB.    - constant cvs_version = "$Id: http.pike,v 1.76 1998/03/26 17:21:53 mast Exp $"; + constant cvs_version = "$Id: http.pike,v 1.77 1998/03/28 01:25:01 neotron Exp $";   // HTTP protocol module.   #include <config.h>   private inherit "roxenlib";
677:    // rest is backtrace.       string reason = roxen->diagnose_error( bt ); -  +  if(sizeof(bt) == 1) // No backtrace?! +  bt += ({ "Unknown error, no backtrace."});    string res = ("<title>Internal Server Error</title>"    "<body bgcolor=white text=black link=darkblue vlink=darkblue>"    "<table width=\"100%\" border=0 cellpadding=0 cellspacing=0>"
731:      void internal_error(array err)   { +  array err2;    if(QUERY(show_internals)) { -  +  err2 = catch {    if(prestate->plain)    {    file = http_low_answer(500,generate_bugreport(err));
739:    }    array(string) bt = (describe_backtrace(err)/"\n") - ({""});    file = http_low_answer(500, format_backtrace(bt)); +  }; +  if(err2) { +  werror("Internal server error in internal_error():\n" + +  describe_backtrace(err)); +  file = http_low_answer(500, "<h1>Error: The server failed to " +  "fulfill your query, due to an " +  "internal error.</h1>"); +  }    } else {    file = http_low_answer(500, "<h1>Error: The server failed to "    "fulfill your query, due to an internal error.</h1>");    } -  +     report_error("Internal server error: " +    describe_backtrace(err) + "\n");   }
845:    else if(method != "GET" && method != "HEAD" && method != "POST")    file = http_low_answer(501, "Not implemented.");    else -  if(catch { +  if(err = catch {    file=http_low_answer(404,    replace(parse_rxml(conf->query("ZNoSuchFile"),    thiso),    ({"$File", "$Me"}),    ({not_query, -  conf->query("MyWorldLocation")})));}) +  conf->query("MyWorldLocation")}))); })    internal_error(err);    } else {    if((file->file == -1) || file->leave_me)