Branch: Tag:

2010-12-03

2010-12-03 21:30:51 by Martin Stjernholm <mast@lysator.liu.se>

Be better at disconnecting on low level internal server errors.

Rev: server/protocols/http.pike:1.634

2:   // Modified by Francesco Chemolli to add throttling capabilities.   // Copyright © 1996 - 2009, Roxen IS.    - constant cvs_version = "$Id: http.pike,v 1.633 2010/11/30 16:28:34 grubba Exp $"; + constant cvs_version = "$Id: http.pike,v 1.634 2010/12/03 21:30:51 mast Exp $";   // #define REQUEST_DEBUG   #define MAGIC_ERROR   
2960:   // Execute the request. This is called from a handler thread.   void handle_request( )   { +  if (mixed err = catch { +     REQUEST_WERR("HTTP: handle_request()");    TIMER_START(handle_request);   
3044:       TIMER_END(handle_request);    send_result(); +  +  }) { +  disconnect(); +  report_error("Internal server error: " + describe_backtrace(err));    } -  + }      /* We got some data on a socket.    * =================================================
3052:   // array ccd = ({});   void got_data(mixed fooid, string s, void|int chained)   { +  if (mixed err = catch { +    #ifdef CONNECTION_DEBUG    werror ("HTTP[%s]: Request ----------------------------------------------\n"    "%O\n", DEBUG_GET_FD, s);
3109:    s = "";    }    -  if (mixed err = catch { +     MARK_FD("HTTP got data");    raw += s;   
3587:    roxen.handle(handle_request);    })    { -  report_error("Internal server error: " + describe_backtrace(err)); +     disconnect(); -  +  report_error("Internal server error: " + describe_backtrace(err));    }   }