Branch: Tag:

1999-12-29

1999-12-29 21:57:55 by Martin Stjernholm <mast@lysator.liu.se>

Added measure to ensure internal_error() works even when this_object()
is destructed.

Rev: server/protocols/http.pike:1.180

2:   // Modified by Francesco Chemolli to add throttling capabilities.   // Copyright © 1996 - 1998, Idonex AB.    - constant cvs_version = "$Id: http.pike,v 1.179 1999/12/27 14:41:36 nilsson Exp $"; + constant cvs_version = "$Id: http.pike,v 1.180 1999/12/29 21:57:55 mast Exp $";      #define MAGIC_ERROR   
1045:    describe_backtrace(err) + "\n");   }    + // This macro ensures that something gets reported even when the very + // call to internal_error() fails. That happens eg when this_object() + // has been destructed. + #define INTERNAL_ERROR(err) \ +  if (mixed __eRr = catch (internal_error (err))) \ +  report_error("Internal server error: " + describe_backtrace(err) + \ +  "internal_error() also failed: " + describe_backtrace(__eRr)) +    int wants_more()   {    return !!cache;
1342:    ({not_query,    conf->query("MyWorldLocation")})));    }) { -  internal_error(err); +  INTERNAL_ERROR(err);    }    } else {    if((file->file == -1) || file->leave_me)
1587:       array e;    if(e= catch(file = conf->handle_request( this_object() ))) -  internal_error( e ); +  INTERNAL_ERROR( e );    send_result();   }