Roxen.git / server / protocols / http.pike

version» Context lines:

Roxen.git/server/protocols/http.pike:3239:    }   #endif /* MAGIC_ERROR */       MARK_FD("HTTP handling request");       handle_time = gethrtime();   #if constant(System.CPU_TIME_IS_THREAD_LOCAL)    handle_vtime = gethrvtime();   #endif    +  // Protect against asynchronous self desctruction. +  object json_logger = this::json_logger; + #ifdef TIMERS +  mapping(string:int) timers = this::timers; + #endif +     mapping result;    array e = catch(result = conf->handle_request( this_object() ));    // Note: Could be destructed here already since handle_request might    // have handed over us to another thread that finished quickly. The    // right place to put code is probably send_result instead.    //    // I wonder exactly where that handing-over might happen. There    // should probably be destruct_threadbound_session_objects calls    // there too. /mast       if (this)    destruct_threadbound_session_objects();       if(e)    INTERNAL_ERROR( e );       else {    if (result && result->pipe) {    REQUEST_WERR("HTTP: handle_request: pipe in progress.");    TIMER_END(handle_request); -  +  // NB: Request may already be completed and we may have been desctructed. +  // Local copys of json_logger and timers (see above) saves us from +  // suffering from trying to use objects in desctructed object.    json_logger->log(([    "event" : "PIPE_BEGIN",    ]));    LOG_HANDLE_END();    return;    }    file = result;    }       if( file && file->try_again_later )