Branch: Tag:

1999-07-15

1999-07-15 16:59:28 by David Hedbor <david@hedbor.org>

Performance tweaking: Added supports caching, rewrote request parsing, fixed HTTP/0.9 support and more

Rev: server/base_server/configuration.pike:1.204
Rev: server/base_server/roxen.pike:1.306
Rev: server/base_server/roxenlib.pike:1.108
Rev: server/etc/include/config.h:1.15
Rev: server/modules/filesystems/filesystem.pike:1.56
Rev: server/modules/misc/contenttypes.pike:1.13
Rev: server/protocols/http.pike:1.142

1:   /* -  * $Id: roxen.pike,v 1.305 1999/07/12 18:34:31 grubba Exp $ +  * $Id: roxen.pike,v 1.306 1999/07/15 16:59:28 neotron Exp $    *    * The Roxen Challenger main program.    *
7:    */      // ABS and suicide systems contributed freely by Francesco Chemolli - constant cvs_version="$Id: roxen.pike,v 1.305 1999/07/12 18:34:31 grubba Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.306 1999/07/15 16:59:28 neotron Exp $";      object backend_thread;   object argcache;
1047:      public multiset find_supports(string from, void|multiset existing_sup)   { -  multiset (string) sup = existing_sup || (< >); +  multiset (string) sup = (< >);    multiset (string) nsup = (< >);       array (function|multiset) s;    string v;    array f;    -  if(!(< "unknown", "" >)[from]) -  { +  if(!strlen(from) || from == "unknown") +  return default_supports|existing_sup; +  if(!(sup = cache_lookup("supports", from))) { +  sup = (<>);    foreach(indices(supports), v)    {    if(!v || !search(from, v))
1070:    }    }    } -  +     if(!sizeof(sup))    {    sup = default_supports;
1078:    perror("Unknown client: \""+from+"\"\n");   #endif    } -  } else { -  sup = default_supports; +  sup -= nsup; +  cache_set("supports", from, sup);    } -  return sup - nsup; +  return sup|existing_sup;   }      public void log(mapping file, object request_id)
3917:    return id->conf;   }    - object find_site_for( object id ) + void find_site_for( object id )   {    if(id->misc->host) -  return find_server_for(id,@lower_case(id->misc->host)/":"); -  return id->conf; +  id->conf = find_server_for(id,@lower_case(id->misc->host)/":");   }