Roxen.git / server / base_server / roxen.pike

version» Context lines:

Roxen.git/server/base_server/roxen.pike:1:   // This file is part of Roxen WebServer.   // Copyright © 1996 - 2004, Roxen IS.   //   // The Roxen WebServer main program.   //   // Per Hedbor, Henrik Grubbström, Pontus Hagland, David Hedbor and others.   // ABS and suicide systems contributed freely by Francesco Chemolli    - constant cvs_version="$Id: roxen.pike,v 1.964 2007/07/31 11:24:53 noring Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.965 2007/08/14 13:54:03 grubba Exp $";      //! @appears roxen   //!   //! The Roxen WebServer main program.      // The argument cache. Used by the image cache.   ArgCache argcache;      // Some headerfiles   #define IN_ROXEN
Roxen.git/server/base_server/roxen.pike:2720: Inside #if undefined(__NT__)
  }      static void engage_abs(int n)   {    if (!query("abs_engage")) {    abs_started = 0;    report_debug("Anti-Block System Disabled.\n");    return;    }    report_debug("**** %s: ABS engaged!\n" -  "Waited more than %d minute(s).\n" -  "Trying to dump backlog: \n", +  "Waited more than %d minute(s).\n",    ctime(time()) - "\n",    query("abs_timeout"));    // Paranoia exit in case describe_all_threads below hangs.    signal(signum("SIGALRM"), low_engage_abs);    int t = alarm(20); -  + #ifdef THREADS +  report_debug("Handler queue:\n");    catch { -  +  array(mixed) queue = handle_queue->buffer[handle_queue->rptr..]; +  foreach(queue; mixed v) { +  if (!v) continue; +  if (!arrayp(v)) { +  report_debug(" *** Strange entry: %O ***\n", v); +  } else { +  report_debug(" %{%O, %}\n", v); +  } +  } +  }; + #endif +  report_debug("Trying to dump backlog: \n"); +  catch {    // Catch for paranoia reasons.    describe_all_threads();    };    low_engage_abs();   }      void restart_if_stuck (int force)   //! @note   //! Must be called from the backend thread due to Linux peculiarities.   {    remove_call_out(restart_if_stuck);    if (!(query("abs_engage") || force))    return;    if(!abs_started)    {    abs_started = 1; -  handlers_alive = time(1); +  handlers_alive = time();    report_debug("Anti-Block System Enabled.\n");    }    call_out (restart_if_stuck,10);   // werror("call_out_info %O\n", filter(call_out_info(), lambda(array a) {   // return a[2] == restart_if_stuck; }));    signal(signum("SIGALRM"), engage_abs);    int t = alarm (60*query("abs_timeout")+20);    // werror("alarm: %d seconds left, set to %d\n", t, 60*query("abs_timeout")+20);    if ((time(1) - handlers_alive) > 60*query("abs_timeout")) {    // The handler installed below hasn't run.    report_debug("**** %s: ABS: Handlers are dead!\n",    ctime(time()) - "\n");    engage_abs(0);    } -  handle(lambda() { handlers_alive = time(1); }); +  handle(lambda() { handlers_alive = time(); });   }   #endif      #if constant(ROXEN_MYSQL_SUPPORTS_UNICODE)   // NOTE: We need to mark binary data as binary in case   // the Mysql character_set_connection has been   // set to anything other than "latin1".   #define MYSQL__BINARY "_binary"   #else   #define MYSQL__BINARY ""