Project

General

Profile

Feature #136 ยป lighttpd-1.3.13-dir-listing.encoding.diff

http://www.perlfu.co.uk/code/lighttpd/lighttpd-1.3.13-dir-listing.encoding.diff -- critson - Anonymous, 2005-05-22 09:45

View differences:

lighttpd-1.3.13/src/base.h 2005-05-22 09:13:18.142338232 +0000
223 223
	buffer *error_handler;
224 224
	buffer *server_tag;
225 225
	buffer *dirlist_css;
226
	buffer *dirlist_encoding;
226 227
	
227 228
	unsigned short dir_listing;
228 229
	unsigned short hide_dotfiles;
lighttpd-1.3.13/src/config.c 2005-05-22 09:13:04.826362568 +0000
75 75
		{ "dir-listing.hide-dotfiles",   NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 39 */
76 76
		{ "dir-listing.external-css",    NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },  /* 40 */
77 77
		
78
		{ "dir-listing.encoding",        NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },  /* 41 */
79
		
78 80
		{ "server.host",                 "use server.bind instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET },
79 81
		{ "server.docroot",              "use server.document-root instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET },
80 82
		{ "server.virtual-root",         "load mod_simple_vhost and use simple-vhost.server-root instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET },
......
126 128
		s->error_handler = buffer_init();
127 129
		s->server_tag    = buffer_init();
128 130
		s->dirlist_css   = buffer_init();
131
		s->dirlist_encoding = buffer_init();
129 132
		s->max_keep_alive_requests = 128;
130 133
		s->max_keep_alive_idle = 30;
131 134
		s->max_read_idle = 60;
......
173 176
		cv[38].destination = s->ssl_ca_file;
174 177
		cv[39].destination = &(s->hide_dotfiles);
175 178
		cv[40].destination = s->dirlist_css;
179
		cv[41].destination = s->dirlist_encoding;
176 180
		
177 181
		srv->config_storage[i] = s;
178 182
	
......
195 199
	PATCH(document_root);
196 200
	PATCH(dir_listing);
197 201
	PATCH(dirlist_css);
202
	PATCH(dirlist_encoding);
198 203
	PATCH(hide_dotfiles);
199 204
	PATCH(indexfiles);
200 205
	PATCH(max_keep_alive_requests);
......
245 250
				PATCH(hide_dotfiles);
246 251
			} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("dir-listing.external-css"))) {
247 252
				PATCH(dirlist_css);
253
			} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("dir-listing.encoding"))) {
254
				PATCH(dirlist_encoding);
248 255
			} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("server.error-handler-404"))) {
249 256
				PATCH(error_handler);
250 257
			} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("server.indexfiles"))) {
lighttpd-1.3.13/src/response.c 2005-05-22 09:28:56.051754328 +0000
735 735
	if (files.used) http_dirls_sort(files.ent, files.used);
736 736

  
737 737
	out = chunkqueue_get_append_buffer(con->write_queue);
738
	BUFFER_COPY_STRING_CONST(out, "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n");
738
	
739
	if (buffer_is_empty(con->conf.dirlist_encoding)) {
740
		BUFFER_COPY_STRING_CONST(out, "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n");
741
	} else {
742
		BUFFER_COPY_STRING_CONST(out, "<?xml version=\"1.0\" encoding=\"");
743
		buffer_append_string_buffer(out, con->conf.dirlist_encoding);
744
		BUFFER_APPEND_STRING_CONST(out, "\"?>\n");
745
	}
746
	
739 747
	http_list_directory_header(out, con);
740 748

  
741 749
	/* directories */
lighttpd-1.3.13/src/server.c 2005-05-22 09:13:28.187811088 +0000
242 242
			buffer_free(s->ssl_ca_file);
243 243
			buffer_free(s->error_handler);
244 244
			buffer_free(s->dirlist_css);
245
			buffer_free(s->dirlist_encoding);
245 246
			array_free(s->indexfiles);
246 247
			array_free(s->mimetypes);
247 248
			
    (1-1/1)