dgaudet     98/02/04 13:23:34

  Modified:    src      CHANGES
               src/main http_protocol.c
  Log:
  Igor found a memory leak -- we're allocating the initial request_rec in
  the connection pool rather than creating a new pool first.  So each
  request on a keepalive connection would waste sizeof(request_rec).
  
  Revision  Changes    Path
  1.616     +2 -0      apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.615
  retrieving revision 1.616
  diff -u -r1.615 -r1.616
  --- CHANGES   1998/02/03 11:19:26     1.615
  +++ CHANGES   1998/02/04 21:23:30     1.616
  @@ -1,4 +1,6 @@
   Changes with Apache 1.3b4
  +  
  +  *) Fix a memory leak on keep-alive connections.  [Igor Tatarinov]
   
     *) Added mod_so module to support dynamic loading of modules on Unix
        (like mod_dld for Win32). This replaces mod_dld.c. Use SharedModule
  
  
  
  1.185     +5 -2      apache-1.3/src/main/http_protocol.c
  
  Index: http_protocol.c
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/src/main/http_protocol.c,v
  retrieving revision 1.184
  retrieving revision 1.185
  diff -u -r1.184 -r1.185
  --- http_protocol.c   1998/02/02 22:33:33     1.184
  +++ http_protocol.c   1998/02/04 21:23:33     1.185
  @@ -773,13 +773,16 @@
   
   request_rec *read_request(conn_rec *conn)
   {
  -    request_rec *r = (request_rec *) pcalloc(conn->pool, 
sizeof(request_rec));
  +    request_rec *r;
       int access_status;
  +    pool *p;
   
  +    p = make_sub_pool(conn->pool);
  +    r = pcalloc(p, sizeof(request_rec));
  +    r->pool            = p;
       r->connection      = conn;
       conn->server       = conn->base_server;
       r->server          = conn->server;
  -    r->pool            = make_sub_pool(conn->pool);
   
       conn->keptalive    = conn->keepalive == 1;
       conn->keepalive    = 0;
  
  
  

Reply via email to