Browse Source

added a switch to disable range requests, this doesn't fix #171 but is a workaround

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.3.x@482 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/heads/lighttpd-1.3.x
Jan Kneschke 17 years ago
parent
commit
6d4a508763
  1. 1
      src/base.h
  2. 7
      src/config.c
  3. 6
      src/response.c

1
src/base.h

@ -234,6 +234,7 @@ typedef struct {
unsigned short max_write_idle;
unsigned short use_xattr;
unsigned short follow_symlink;
unsigned short range_requests;
/* debug */

7
src/config.c

@ -77,6 +77,7 @@ static int config_insert(server *srv) {
{ "dir-listing.encoding", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 41 */
{ "server.errorlog-use-syslog", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 42 */
{ "server.range-requests", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 43 */
{ "server.host", "use server.bind instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET },
{ "server.docroot", "use server.document-root instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET },
@ -142,6 +143,7 @@ static int config_insert(server *srv) {
s->follow_symlink = 1;
s->kbytes_per_second = 0;
s->allow_http11 = 1;
s->range_requests = 1;
s->global_kbytes_per_second = 0;
s->global_bytes_per_second_cnt = 0;
s->global_bytes_per_second_cnt_ptr = &s->global_bytes_per_second_cnt;
@ -182,6 +184,7 @@ static int config_insert(server *srv) {
cv[39].destination = &(s->hide_dotfiles);
cv[40].destination = s->dirlist_css;
cv[41].destination = s->dirlist_encoding;
cv[43].destination = &(s->range_requests);
srv->config_storage[i] = s;
@ -228,6 +231,8 @@ int config_setup_connection(server *srv, connection *con) {
PATCH(log_request_handling);
PATCH(log_file_not_found);
PATCH(range_requests);
return 0;
}
@ -253,6 +258,8 @@ int config_patch_connection(server *srv, connection *con, const char *stage, siz
PATCH(document_root);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("server.dir-listing"))) {
PATCH(dir_listing);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("server.range-requests"))) {
PATCH(range_requests);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("dir-listing.hide-dotfiles"))) {
PATCH(hide_dotfiles);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("dir-listing.external-css"))) {

6
src/response.c

@ -1290,7 +1290,7 @@ handler_t http_response_prepare(server *srv, connection *con) {
* shorten uri.path
*/
con->uri.path->used -= strlen(pathinfo);
con->uri.path->used -= con->request.pathinfo->used - 1;
con->uri.path->ptr[con->uri.path->used - 1] = '\0';
}
@ -1451,7 +1451,9 @@ handler_t http_response_prepare(server *srv, connection *con) {
http_response_handle_cachable(srv, con, con->fce->st.st_mtime);
if (con->http_status == 0 && con->request.http_range) {
if (con->conf.range_requests &&
con->http_status == 0 &&
con->request.http_range) {
http_response_parse_range(srv, con);
} else if (con->http_status == 0) {
switch(r = plugins_call_handle_physical_path(srv, con)) {

Loading…
Cancel
Save