Browse Source

merged [1217]

fixed allow-http-11


git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.11-ssl-fixes@1282 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.12
Jan Kneschke 16 years ago
parent
commit
3b73da83a2
  1. 3
      NEWS
  2. 26
      src/array.h
  3. 17
      src/configfile-glue.c
  4. 1
      src/configparser.y
  5. 8
      src/response.c

3
NEWS

@ -9,6 +9,7 @@ NEWS
* added Content-Range support for PUT in webdav
* added support for += on empty arrays in config-files
* added ssl.cipher-list and ssl.use-sslv2
* added $HTTP["querystring"] conditional
* fixed upload hangs with SSL
* fixed connection drops with SSL (aka bad retry)
* fixed path traversal with \ on cygwin
@ -20,6 +21,8 @@ NEWS
* fixed default-shell if SHELL is not set (#441)
* fixed appending and assigning of env.* vars
* fixed empty FCGI_STDERR packets
* fixed conditional server.allow-http-11
* fixed handling of follow-symlink + lstat()
- 1.4.11 - 2006-03-09

26
src/array.h

@ -66,12 +66,30 @@ typedef struct {
data_array *data_array_init(void);
typedef enum { CONFIG_COND_UNSET, CONFIG_COND_EQ, CONFIG_COND_MATCH, CONFIG_COND_NE, CONFIG_COND_NOMATCH } config_cond_t;
#define PATCHES NULL, "SERVERsocket", "HTTPurl", "HTTPhost", "HTTPreferer", "HTTPuseragent", "HTTPcookie", "HTTPremoteip"
/**
* possible compare ops in the configfile parser
*/
typedef enum {
CONFIG_COND_UNSET,
CONFIG_COND_EQ, /** == */
CONFIG_COND_MATCH, /** =~ */
CONFIG_COND_NE, /** != */
CONFIG_COND_NOMATCH /** !~ */
} config_cond_t;
/**
* possible fields to match against
*/
typedef enum {
COMP_UNSET,
COMP_SERVER_SOCKET, COMP_HTTP_URL, COMP_HTTP_HOST, COMP_HTTP_REFERER, COMP_HTTP_USERAGENT, COMP_HTTP_COOKIE, COMP_HTTP_REMOTEIP
COMP_SERVER_SOCKET,
COMP_HTTP_URL,
COMP_HTTP_HOST,
COMP_HTTP_REFERER,
COMP_HTTP_USERAGENT,
COMP_HTTP_COOKIE,
COMP_HTTP_REMOTEIP,
COMP_HTTP_QUERYSTRING
} comp_key_t;
/* $HTTP["host"] == "incremental.home.kneschke.de" { ... }

17
src/configfile-glue.c

@ -308,6 +308,10 @@ static cond_result_t config_check_cond_nocache(server *srv, connection *con, dat
l = con->uri.path;
break;
case COMP_HTTP_QUERYSTRING:
l = con->uri.query;
break;
case COMP_SERVER_SOCKET:
l = srv_sock->srv_token;
break;
@ -428,6 +432,19 @@ static cond_result_t config_check_cond_cached(server *srv, connection *con, data
return caches[dc->context_ndx].result;
}
void config_cond_cache_reset(server *srv, connection *con) {
#if COND_RESULT_UNSET
size_t i;
for (i = srv->config_context->used - 1; i >= 0; i --) {
con->cond_cache[i].result = COND_RESULT_UNSET;
con->cond_cache[i].patterncount = 0;
}
#else
memset(con->cond_cache, 0, sizeof(cond_cache_t) * srv->config_context->used);
#endif
}
int config_check_cond(server *srv, connection *con, data_config *dc) {
if (con->conf.log_condition_handling) {
log_error_write(srv, __FILE__, __LINE__, "s", "=== start of condition block ===");

1
src/configparser.y

@ -417,6 +417,7 @@ context ::= DOLLAR SRVVARNAME(B) LBRACKET stringop(C) RBRACKET cond(E) expressio
{ COMP_HTTP_USERAGENT, CONST_STR_LEN("HTTP[\"useragent\"]" ) },
{ COMP_HTTP_COOKIE, CONST_STR_LEN("HTTP[\"cookie\"]" ) },
{ COMP_HTTP_REMOTEIP, CONST_STR_LEN("HTTP[\"remoteip\"]" ) },
{ COMP_HTTP_QUERYSTRING, CONST_STR_LEN("HTTP[\"querystring\"]") },
{ COMP_UNSET, NULL, 0 },
};
size_t i;

8
src/response.c

@ -261,7 +261,13 @@ handler_t http_response_prepare(server *srv, connection *con) {
*/
config_patch_connection(srv, con, COMP_HTTP_URL); /* HTTPurl */
config_patch_connection(srv, con, COMP_HTTP_QUERYSTRING); /* HTTPqs */
/* do we have to downgrade to 1.0 ? */
if (!con->conf.allow_http11) {
con->request.http_version = HTTP_VERSION_1_0;
}
switch(r = plugins_call_handle_uri_clean(srv, con)) {
case HANDLER_GO_ON:
break;

Loading…
Cancel
Save