Changeset 1528

Show
Ignore:
Timestamp:
01/27/2007 02:14:55 PM (1 year ago)
Author:
jan
Message:

added $PHYSICALpath? and $HTTPrequest-method?

* configparser.y

  • added the new options and added alternative names for user-agent,
    remote-ip and query-string
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/array.h

    r1526 r1528  
    8787        COMP_HTTP_HOST, 
    8888        COMP_HTTP_REFERER, 
    89         COMP_HTTP_USERAGENT, 
     89        COMP_HTTP_USER_AGENT, 
    9090        COMP_HTTP_COOKIE, 
    91         COMP_HTTP_REMOTEIP, 
    92         COMP_HTTP_QUERYSTRING 
     91        COMP_HTTP_REMOTE_IP, 
     92        COMP_HTTP_QUERY_STRING, 
     93        COMP_HTTP_REQUEST_METHOD, 
     94        COMP_PHYSICAL_PATH 
    9395} comp_key_t; 
    9496 
  • trunk/src/configfile-glue.c

    r1526 r1528  
    280280                break; 
    281281        } 
    282         case COMP_HTTP_REMOTEIP: { 
     282        case COMP_HTTP_REMOTE_IP: { 
    283283                char *nm_slash; 
    284284                /* handle remoteip limitations 
     
    355355                break; 
    356356 
    357         case COMP_HTTP_QUERYSTRING: 
     357        case COMP_HTTP_QUERY_STRING: 
    358358                l = con->uri.query; 
    359359                break; 
     
    382382                break; 
    383383        } 
    384         case COMP_HTTP_USERAGENT: { 
     384        case COMP_HTTP_USER_AGENT: { 
    385385                data_string *ds; 
    386386                if (NULL != (ds = (data_string *)array_get_element(con->request.headers, CONST_STR_LEN("User-Agent")))) { 
     
    391391                break; 
    392392        } 
    393  
     393        case COMP_HTTP_REQUEST_METHOD: { 
     394                const char *method = get_http_method_name(con->request.http_method); 
     395 
     396                /* we only have the request method as const char but we need a buffer for comparing */ 
     397 
     398                buffer_copy_string(srv->tmp_buf, method); 
     399 
     400                l = srv->tmp_buf; 
     401 
     402                break; 
     403        } 
     404        case COMP_PHYSICAL_PATH: { 
     405                l = con->physical.path; 
     406                break; 
     407        } 
    394408        default: 
    395409                return COND_RESULT_FALSE; 
  • trunk/src/configparser.y

    r1526 r1528  
    420420      { COMP_HTTP_HOST,          CONST_STR_LEN("HTTP[\"host\"]"       ) }, 
    421421      { COMP_HTTP_REFERER,       CONST_STR_LEN("HTTP[\"referer\"]"    ) }, 
    422       { COMP_HTTP_USERAGENT,     CONST_STR_LEN("HTTP[\"useragent\"]"  ) }, 
     422      { COMP_HTTP_USER_AGENT,    CONST_STR_LEN("HTTP[\"useragent\"]"  ) }, 
     423      { COMP_HTTP_USER_AGENT,    CONST_STR_LEN("HTTP[\"user-agent\"]"  ) }, 
    423424      { COMP_HTTP_COOKIE,        CONST_STR_LEN("HTTP[\"cookie\"]"     ) }, 
    424       { COMP_HTTP_REMOTEIP,      CONST_STR_LEN("HTTP[\"remoteip\"]"   ) }, 
    425       { COMP_HTTP_QUERYSTRING,   CONST_STR_LEN("HTTP[\"querystring\"]") }, 
     425      { COMP_HTTP_REMOTE_IP,     CONST_STR_LEN("HTTP[\"remoteip\"]"   ) }, 
     426      { COMP_HTTP_REMOTE_IP,     CONST_STR_LEN("HTTP[\"remote-ip\"]"   ) }, 
     427      { COMP_HTTP_QUERY_STRING,  CONST_STR_LEN("HTTP[\"querystring\"]") }, 
     428      { COMP_HTTP_QUERY_STRING,  CONST_STR_LEN("HTTP[\"query-string\"]") }, 
     429      { COMP_HTTP_REQUEST_METHOD, CONST_STR_LEN("HTTP[\"request-method\"]") }, 
     430      { COMP_PHYSICAL_PATH,      CONST_STR_LEN("PHYSICAL[\"path\"]") }, 
    426431      { COMP_UNSET, NULL, 0 }, 
    427432    }; 
  • trunk/src/response.c

    r1503 r1528  
    188188 
    189189                config_patch_connection(srv, con, COMP_HTTP_HOST);      /* Host:        */ 
    190                 config_patch_connection(srv, con, COMP_HTTP_REMOTEIP); /* Client-IP */ 
     190                config_patch_connection(srv, con, COMP_HTTP_REMOTE_IP); /* Client-IP */ 
    191191                config_patch_connection(srv, con, COMP_HTTP_REFERER);   /* Referer:     */ 
    192                 config_patch_connection(srv, con, COMP_HTTP_USERAGENT); /* User-Agent:  */ 
     192                config_patch_connection(srv, con, COMP_HTTP_USER_AGENT);/* User-Agent:  */ 
    193193                config_patch_connection(srv, con, COMP_HTTP_COOKIE);    /* Cookie:  */ 
    194194 
     
    277277 
    278278                config_patch_connection(srv, con, COMP_HTTP_URL); /* HTTPurl */ 
    279                 config_patch_connection(srv, con, COMP_HTTP_QUERYSTRING); /* HTTPqs */ 
     279                config_patch_connection(srv, con, COMP_HTTP_QUERY_STRING); /* HTTPqs */ 
    280280 
    281281                /* do we have to downgrade to 1.0 ? */ 
     
    629629                } 
    630630 
     631                config_patch_connection(srv, con, COMP_PHYSICAL_PATH);    /* physical-path  */ 
     632 
    631633                if (con->conf.log_request_handling) { 
    632634                        log_error_write(srv, __FILE__, __LINE__,  "s",  "-- handling subrequest");