Changeset 644

Show
Ignore:
Timestamp:
02/15/07 00:34:14 (2 years ago)
Author:
alo
Message:

--

Files:

Legend:

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

    r642 r644  
     12007-02-14  Alvaro Lopez Ortega  <alvaro@alobbs.com> 
     2 
     3        * cherokee/http.h, cherokee/http.c (cherokee_http_code_to_string) 
     4        (cherokee_http_code_copy): Added http_gateway_timeout. 
     5 
    162007-02-03  A.D.F  <adefacc@tin.it> 
    27        * cherokee/macros.h: 
  • cherokee/trunk/cherokee/http.c

    r633 r644  
    116116        case http_continue:                 *str = http_continue_string; break; 
    117117        case http_switching_protocols:      *str = http_switching_protocols_string; break; 
     118        case http_gateway_timeout:          *str = http_gateway_timeout_string; break; 
    118119        default: 
    119120                *str = "500 Unknown error"; 
     
    154155                entry_code (bad_gateway); 
    155156                entry_code (service_unavailable); 
     157                entry_code (gateway_timeout); 
    156158        default: 
    157159                PRINT_ERROR ("ERROR: Unknown HTTP status code %d\n", code); 
  • cherokee/trunk/cherokee/http.h

    r633 r644  
    105105        http_internal_error           = 500, 
    106106        http_bad_gateway              = 502, 
    107         http_service_unavailable      = 503 
     107        http_service_unavailable      = 503, 
     108        http_gateway_timeout          = 504 
    108109} cherokee_http_t; 
    109110 
     
    130131#define http_bad_gateway_string              "502 Bad gateway" 
    131132#define http_service_unavailable_string      "503 Service Unavailable" 
     133#define http_gateway_timeout_string          "504 Gatewat Timeout" 
    132134 
    133135#define http_type_200_max 206 
  • cherokee/trunk/cherokee/util.c

    r625 r644  
    146146        return (s1<s2) ? s1 : s2; 
    147147} 
     148 
     149 
     150char * 
     151cherokee_max_str (char *s1, char *s2) 
     152{ 
     153        if ((s1 == NULL) &&  
     154            (s2 == NULL)) return NULL; 
     155 
     156        if ((s1 != NULL) &&  
     157            (s2 == NULL)) return s1; 
     158 
     159        if ((s2 != NULL) &&  
     160            (s1 == NULL)) return s2; 
     161         
     162        return (s1>s2) ? s1 : s2; 
     163} 
     164 
    148165 
    149166 
     
    12651282} 
    12661283 
     1284 
     1285ret_t  
     1286cherokee_get_shell (const char **shell, const char **binary) 
     1287{ 
     1288        char *t1, *t2; 
     1289 
     1290        /* Set the shell path 
     1291         */ 
     1292#ifdef _WIN32 
     1293        *shell = getenv("ComSpec"); 
     1294#else 
     1295        *shell = "/bin/sh"; 
     1296#endif 
     1297 
     1298        /* Find the binary 
     1299         */ 
     1300        t1 = rindex (*shell, '\\'); 
     1301        t2 = rindex (*shell, '/'); 
     1302 
     1303        t1 = cherokee_max_str (t1, t2); 
     1304        if (t1 == NULL) return ret_error; 
     1305 
     1306        *binary = &t1[1]; 
     1307 
     1308        return ret_ok; 
     1309} 
  • cherokee/trunk/cherokee/util.h

    r597 r644  
    7575int     cherokee_isbigendian        (void); 
    7676char   *cherokee_min_str            (char *s1, char *s2); 
     77char   *cherokee_max_str            (char *s1, char *s2); 
    7778char   *cherokee_strfsize           (unsigned long long size, char *buf); 
    7879size_t  cherokee_strlcat            (char *dst, const char *src, size_t siz); 
     
    100101ret_t cherokee_sys_fdlimit_set (cuint_t  limit); 
    101102ret_t cherokee_close_fd        (cint_t fd); 
     103ret_t cherokee_get_shell       (const char **shell, const char **binary); 
    102104void  cherokee_trace (const char *entry, const char *file, int line, const char *func, const char *fmt, ...); 
    103105