Branch: Tag:

1998-02-04

1998-02-04 16:10:52 by Per Hedbor <ph@opera.com>

Added profining, removed 4711 Privs, added call_out workaround

Rev: server/base_server/configuration.pike:1.92
Rev: server/base_server/disk_cache.pike:1.33
Rev: server/base_server/privs.pike:1.32
Rev: server/base_server/read_config.pike:1.18
Rev: server/base_server/roxen.pike:1.163
Rev: server/base_server/roxenloader.pike:1.55
Rev: server/config_actions/generate_rsa.pike:1.5
Rev: server/modules/filesystems/filesystem.pike:1.26
Rev: server/modules/filesystems/restrictedfs.pike:1.7
Rev: server/modules/filesystems/userfs.pike:1.17
Rev: server/modules/graphics/business_graphics/business.pike:1.63
Rev: server/modules/graphics/graphic_text.pike:1.99
Rev: server/modules/misc/ip-less_hosts.pike:1.8
Rev: server/modules/misc/mirrorserver.pike:1.13
Rev: server/modules/misc/userdb.pike:1.23
Rev: server/modules/scripting/cgi.pike:1.70
Rev: server/modules/scripting/pikescript.pike:1.20
Rev: server/modules/tags/htmlparse.pike:1.74
Rev: server/protocols/ftp.pike:1.77
Rev: server/protocols/http.pike:1.52
Rev: server/start:1.25

1:   // This is a roxen module. (c) Informationsv√§varna AB 1996.    - constant cvs_version = "$Id: http.pike,v 1.51 1998/02/04 05:26:00 per Exp $"; + constant cvs_version = "$Id: http.pike,v 1.52 1998/02/04 16:10:52 per Exp $";   // HTTP protocol module.   #include <config.h>   private inherit "roxenlib";   int first; -  + #if efun(gethrtime) + # define HRTIME() gethrtime() + # define HRSEC(X) ((int)((X)*1000000)) + # define SECHR(X) ((X)/(float)1000000) + #else + # define HRTIME() (time()) + # define HRSEC(X) (X) + # define SECHR(X) ((float)(X)) + #endif    -  + int req_time = HRTIME(); +    constant decode=roxen->decode;   constant find_supports=roxen->find_supports;   constant version=roxen->version;
651:      void end(string|void s)   { + #ifdef PROFILE +  if(conf) +  { +  float elapsed = SECHR(HRTIME()-req_time); +  array p; +  if(!(p=conf->profile_map[not_query])) +  p = conf->profile_map[not_query] = ({0,0.0,0.0}); +  conf->profile_map[not_query][0]++; +  p[1] += elapsed; +  if(elapsed > p[2]) p[2]=elapsed; +  } + #endif   // trace(9);   #if _DEBUG_HTTP_OBJECTS    if(my_fd) catch{mark_fd(my_fd->query_fd(), "");};
686:      static void do_timeout(mapping foo)   { +  int elapsed = HRTIME()-req_time; +  if(elapsed > HRSEC(30)) +  {   #if _DEBUG_HTTP_OBJECTS    my_state = 10;   #endif
693: Inside #if _DEBUG_HTTP_OBJECTS
  #if _DEBUG_HTTP_OBJECTS    roxen->httpobjects[my_id] += " - timed out";   #endif -  end((prot||"HTTP/1.0")+" 408 Timeout\r\n\r\n"); +  end("HTTP/1.0 408 Timeout\r\n" +  "Content-type: text/plain\r\n" +  "Server: Roxen Challenger\r\n" +  "\r\n" +  "Your connection timed out.\n" +  "Please try again.\n"); +  } else { +  // premature call_out... +  werror("got premature call_out to do_timeout. Odd.\n"); +  call_out(do_timeout, 10);    } -  + }         #ifdef KEEP_CONNECTION_ALIVE