Changeset 1763

Show
Ignore:
Timestamp:
08/07/08 16:14:18 (4 months ago)
Author:
alo
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • cherokee/trunk/ChangeLog

    r1760 r1763  
    112008-08-07  Alvaro Lopez Ortega  <alvaro@alobbs.com> 
     2 
     3        * cherokee/connection.c (cherokee_connection_parse_header): Adds a 
     4        check to ensure that the server will not use keepalive when it is 
     5        about to reach the overload limit (>95% of the total capacity). 
    26 
    37        * cherokee/server.c (cherokee_server_new): timeout is 5 seconds 
  • cherokee/trunk/cherokee/connection.c

    r1754 r1763  
    17151715        } 
    17161716 
     1717        /* Don't use keepalive if the server is about to be overloaded 
     1718         */ 
     1719        if ((conn->keepalive) && 
     1720            (CONN_THREAD(conn)->conns_max > CONN_SRV(conn)->conns_keepalive_max)) 
     1721        { 
     1722                conn->keepalive = 0; 
     1723        } 
     1724 
    17171725        /* Look for "Range:"  
    17181726         */ 
     
    17781786         * then verify whether the handler supports it. 
    17791787         */ 
    1780         if ((HANDLER_SUPPORTS (conn->handler, hsupport_length) == 0) &&  
    1781             (HANDLER_SUPPORTS (conn->handler, hsupport_maybe_length) == 0) && 
    1782             conn->keepalive != 0) { 
     1788        if ((conn->keepalive != 0) && 
     1789            (HANDLER_SUPPORTS (conn->handler, hsupport_length) == 0) &&  
     1790            (HANDLER_SUPPORTS (conn->handler, hsupport_maybe_length) == 0)) 
     1791        { 
    17831792                conn->keepalive = 0; 
    17841793        } 
  • cherokee/trunk/cherokee/server-protected.h

    r1715 r1763  
    120120        cuint_t                    conns_num_bogo; 
    121121 
     122        cherokee_boolean_t         keepalive; 
     123        cuint_t                    keepalive_max; 
     124 
    122125        /* Networking config 
    123126         */ 
     
    161164        cherokee_buffer_t          timeout_header; 
    162165 
    163         cherokee_boolean_t         keepalive; 
    164         uint32_t                   keepalive_max; 
    165  
    166166        struct { 
    167167                off_t min; 
  • cherokee/trunk/cherokee/thread.h

    r1759 r1763  
    7575        cherokee_boolean_t      exit; 
    7676 
    77         int                     conns_num;          /* open connections */ 
    78         int                     conns_max;          /* max opened conns */ 
     77        cuint_t                 conns_num;          /* open connections */ 
     78        cuint_t                 conns_max;          /* max opened conns */ 
    7979 
    8080        int                     active_list_num;    /* active connections */