Changeset 2112

Show
Ignore:
Timestamp:
03/02/2008 11:46:44 AM (6 months ago)
Author:
moo
Message:

merged part of [1528] from trunk: added the new options and added alternative names for user-agent, remote-ip and query-string

Location:
branches/lighttpd-1.4.x/src
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • branches/lighttpd-1.4.x/src/array.h

    r2012 r2112  
    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, 
    9393        COMP_HTTP_SCHEME, 
     94        COMP_HTTP_REQUEST_METHOD, 
    9495 
    9596        COMP_LAST_ELEMENT 
  • branches/lighttpd-1.4.x/src/configfile-glue.c

    r2012 r2112  
    278278                break; 
    279279        } 
    280         case COMP_HTTP_REMOTEIP: { 
     280        case COMP_HTTP_REMOTE_IP: { 
    281281                char *nm_slash; 
    282282                /* handle remoteip limitations 
     
    350350                break; 
    351351 
    352         case COMP_HTTP_QUERYSTRING: 
     352        case COMP_HTTP_QUERY_STRING: 
    353353                l = con->uri.query; 
    354354                break; 
     
    377377                break; 
    378378        } 
    379         case COMP_HTTP_USERAGENT: { 
     379        case COMP_HTTP_USER_AGENT: { 
    380380                data_string *ds; 
    381381                if (NULL != (ds = (data_string *)array_get_element(con->request.headers, "User-Agent"))) { 
     
    386386                break; 
    387387        } 
    388  
     388        case COMP_HTTP_REQUEST_METHOD: { 
     389                const char *method = get_http_method_name(con->request.http_method); 
     390 
     391                /* we only have the request method as const char but we need a buffer for comparing */ 
     392 
     393                buffer_copy_string(srv->tmp_buf, method); 
     394 
     395                l = srv->tmp_buf; 
     396 
     397                break; 
     398        } 
    389399        default: 
    390400                return COND_RESULT_FALSE; 
  • branches/lighttpd-1.4.x/src/configparser.y

    r2102 r2112  
    422422      { COMP_HTTP_HOST,          CONST_STR_LEN("HTTP[\"host\"]"       ) }, 
    423423      { COMP_HTTP_REFERER,       CONST_STR_LEN("HTTP[\"referer\"]"    ) }, 
    424       { COMP_HTTP_USERAGENT,     CONST_STR_LEN("HTTP[\"useragent\"]"  ) }, 
     424      { COMP_HTTP_USER_AGENT,    CONST_STR_LEN("HTTP[\"useragent\"]"  ) }, 
     425      { COMP_HTTP_USER_AGENT,    CONST_STR_LEN("HTTP[\"user-agent\"]"  ) }, 
    425426      { COMP_HTTP_COOKIE,        CONST_STR_LEN("HTTP[\"cookie\"]"     ) }, 
    426       { COMP_HTTP_REMOTEIP,      CONST_STR_LEN("HTTP[\"remoteip\"]"   ) }, 
    427       { COMP_HTTP_QUERYSTRING,   CONST_STR_LEN("HTTP[\"querystring\"]") }, 
     427      { COMP_HTTP_REMOTE_IP,     CONST_STR_LEN("HTTP[\"remoteip\"]"   ) }, 
     428      { COMP_HTTP_REMOTE_IP,     CONST_STR_LEN("HTTP[\"remote-ip\"]"   ) }, 
     429      { COMP_HTTP_QUERY_STRING,  CONST_STR_LEN("HTTP[\"querystring\"]") }, 
     430      { COMP_HTTP_QUERY_STRING,  CONST_STR_LEN("HTTP[\"query-string\"]") }, 
     431      { COMP_HTTP_REQUEST_METHOD, CONST_STR_LEN("HTTP[\"request-method\"]") }, 
    428432      { COMP_HTTP_SCHEME,        CONST_STR_LEN("HTTP[\"scheme\"]"     ) }, 
    429433      { COMP_UNSET, NULL, 0 }, 
  • branches/lighttpd-1.4.x/src/response.c

    r2095 r2112  
    188188                config_patch_connection(srv, con, COMP_HTTP_SCHEME);    /* Scheme:      */ 
    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 */ 
    280279 
    281280                /* do we have to downgrade to 1.0 ? */