Branch: Tag:

2000-08-14

2000-08-14 22:50:53 by Martin Stjernholm <mast@lysator.liu.se>

Some changes from Per: (Noncomplete) fix of the conf object optimization
for keepalives. Recorporated some things from the old http protocol.

Rev: server/base_server/configuration.pike:1.337
Rev: server/base_server/roxen.pike:1.520
Rev: server/protocols/http.pike:1.245

2:   // Modified by Francesco Chemolli to add throttling capabilities.   // Copyright © 1996 - 2000, Roxen IS.    - constant cvs_version = "$Id: http.pike,v 1.244 2000/08/14 19:54:19 per Exp $"; + constant cvs_version = "$Id: http.pike,v 1.245 2000/08/14 22:50:50 mast Exp $";   // #define REQUEST_DEBUG   #define MAGIC_ERROR   #define RAM_CACHE
1116:    o->conf = conf;    o->pipe = pipe;    MARK_FD("HTTP kept alive"); -  o->chain( my_fd, port_obj, leftovers ); -  my_fd = 0; +  object fd = my_fd; +  my_fd=0; +  o->chain(fd,port_obj,leftovers);    pipe = 0; -  destruct(); +  disconnect();    return;    }   
1134:    };    my_fd = 0;    } -  destruct(); +  disconnect();   }      static void do_timeout()
2008:       TIMER("charset");    -  if( !conf ) +  if( !conf || !conf->path[port_obj] )    {    // FIXME: port_obj->name & port_obj->default_port are constant    // consider caching them?
2032:    // }    // }    } +  else +  { +  string path; +  if(strlen(path = conf->path[ port_obj ])) +  { +  not_query = not_query[strlen(path)..]; +  misc->site_prefix_path = path; +  } +  }    -  +     TIMER("conf");       if (rawauth)
2198:    my_fd = f;    port_obj = c;    processed = 0; +  do_not_disconnect=-1; // Block destruction until we return.    MARK_FD("Kept alive");    time = _time(1);    -  if( strlen( le ) ) +  if ( strlen( le ) )    got_data( 0,le );    else    {
2210:    call_out(do_timeout, 150);    }    -  if( !processed ) +  if(!my_fd)    { -  f->set_close_callback( end ); -  f->set_read_callback( got_data ); +  if(do_not_disconnect == -1) +  { +  do_not_disconnect=0; +  disconnect();    }    } -  +  else +  { +  if(do_not_disconnect == -1) +  do_not_disconnect = 0; +  if(!processed) +  { +  f->set_nonblocking(got_data, 0, end); +  } +  } + }      string _sprintf( )   {