Changeset 910

Show
Ignore:
Timestamp:
09/06/07 19:50:30 (1 year ago)
Author:
alo
Message:

--

Files:

Legend:

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

    r909 r910  
    112007-09-06  Alvaro Lopez Ortega  <alvaro@alobbs.com> 
     2 
     3        * cherokee/thread.c cherokee/handler.h cherokee/connection.c: 
     4        Handler support macros cleaned up. 
    25 
    36        * cherokee/connection.c (cherokee_connection_build_header): If the 
  • cherokee/trunk/cherokee/connection.c

    r909 r910  
    527527        /* If the handler requires not to add headers, exit. 
    528528         */ 
    529         if (HANDLER_SUPPORTS (conn->handler, dont_add_headers))  
     529        if (HANDLER_SUPPORTS (conn->handler, hsupport_dont_add_headers))  
    530530                return ret_ok; 
    531531 
     
    546546 
    547547        if ((conn->keepalive != 0) && 
    548             HANDLER_SUPPORTS(conn->handler, maybe_length)) { 
     548            HANDLER_SUPPORTS(conn->handler, hsupport_maybe_length)) { 
    549549                if (strcasestr (conn->header_buffer.buf, "Content-Length: ") == NULL) { 
    550550                        conn->keepalive = 0; 
     
    801801         * it has to count the bytes sent 
    802802         */ 
    803         if (!HANDLER_SUPPORT_LENGTH(conn->handler)) { 
     803        if (!HANDLER_SUPPORTS (conn->handler, hsupport_length)) { 
    804804                conn->range_end += sent; 
    805805        } 
     
    17971797        /* Look for "Range:"  
    17981798         */ 
    1799         if (HANDLER_SUPPORT_RANGE(conn->handler)) { 
     1799        if (HANDLER_SUPPORTS (conn->handler, hsupport_range)) { 
    18001800                ret = cherokee_header_get_known (&conn->header, header_range, &ptr, &ptr_len); 
    18011801                if (ret == ret_ok) { 
     
    18581858         * then verify whether the handler supports it. 
    18591859         */ 
    1860         if ((HANDLER_SUPPORT_LENGTH(conn->handler) == 0) &&  
    1861             (HANDLER_SUPPORT_MAYBE_LENGTH(conn->handler) == 0) && 
    1862                conn->keepalive != 0) { 
     1860        if ((HANDLER_SUPPORTS (conn->handler, hsupport_length) == 0) &&  
     1861            (HANDLER_SUPPORTS (conn->handler, hsupport_maybe_length) == 0) && 
     1862            conn->keepalive != 0) { 
    18631863                conn->keepalive = 0; 
    18641864        } 
     
    18841884                at_end = true; 
    18851885        else 
    1886                 at_end = ! HANDLER_SUPPORT_LENGTH(conn->handler); 
     1886                at_end = ! HANDLER_SUPPORTS (conn->handler, hsupport_length); 
    18871887 
    18881888        /* Set the option bit mask 
  • cherokee/trunk/cherokee/handler.h

    r909 r910  
    8181 
    8282 
    83 #define HANDLER(x)                         ((cherokee_handler_t *)(x)) 
    84 #define HANDLER_CONN(h)                    (CONN(HANDLER(h)->connection)) 
    85 #define HANDLER_SRV(h)                     (CONN_SRV(HANDLER_CONN(h))) 
    86 #define HANDLER_THREAD(h)                  (CONN_THREAD(HANDLER_CONN(h))) 
    87 #define HANDLER_SUPPORT_RANGE(h)           (HANDLER(h)->support & hsupport_range) 
    88 #define HANDLER_SUPPORT_LENGTH(h)          (HANDLER(h)->support & hsupport_length) 
    89 #define HANDLER_SUPPORT_MAYBE_LENGTH(h)    (HANDLER(h)->support & hsupport_maybe_length) 
    90 #define HANDLER_SUPPORT_COMPLEX_HEADERS(h) (HANDLER(h)->support & hsupport_complex_headers) 
    91 #define HANDLER_SUPPORT_ERROR(h)           (HANDLER(h)->support & hsupport_error) 
    92 #define HANDLER_SUPPORTS(h,s)              (HANDLER(h)->support & hsupport_ ## s) 
     83#define HANDLER(x)             ((cherokee_handler_t *)(x)) 
     84#define HANDLER_CONN(h)        (CONN(HANDLER(h)->connection)) 
     85#define HANDLER_SRV(h)         (CONN_SRV(HANDLER_CONN(h))) 
     86#define HANDLER_THREAD(h)      (CONN_THREAD(HANDLER_CONN(h))) 
     87#define HANDLER_SUPPORTS(h,s)  (HANDLER(h)->support & s) 
     88 
    9389 
    9490/* Module information 
  • cherokee/trunk/cherokee/thread.c

    r892 r910  
    11141114                             http_type_400(conn->error_code) || 
    11151115                             http_type_500(conn->error_code)) && 
    1116                             conn->handler && (!HANDLER_SUPPORT_ERROR(conn->handler))) 
     1116                            conn->handler && (!HANDLER_SUPPORTS (conn->handler, hsupport_error))) 
    11171117                        { 
    11181118                                /* Try to setup an error handler 
     
    11641164                             http_type_400 (conn->error_code) || 
    11651165                             http_type_500 (conn->error_code)) && 
    1166                             (!HANDLER_SUPPORT_ERROR(conn->handler))) { 
     1166                            (!HANDLER_SUPPORTS (conn->handler, hsupport_error))) { 
    11671167                                conn->phase = phase_setup_connection; 
    11681168                                continue;