Age | Commit message (Collapse) | Author | Files |
|
* fileserv.c (http_log): Avoid dereferencing NULL pointers.
|
|
|
|
|
|
* src/Makefile.am: Install fileserv to sbin.
* src/fileserv.8: Update.
* src/fileserv.c: New option -V
|
|
|
|
|
|
|
|
* src/fileserv.c (urimap_find): Fix eventual null pointer dereference.
|
|
* src/Makefile.am: Install fileserv.conf, unless it already exists.
* src/config.c: Rename pid-file to pidfile, and mime-magic-file to
mime-types-file. Retain old names for compatibility.
* src/defidx.html: Minor fix.
* src/fileserv.8: Rewrite.
* src/fileserv.conf: New file.
* src/idx.c (exp_filetype): Remove useless return.
|
|
* src/fileserv.c (http_server)
(http_sentinel): New functions.
(main): New command line option -s (single process).
Start sentinel unless -s is given.
|
|
|
|
* src/idx.c (directory_index): Fix conditional expression.
|
|
|
|
Provide built-in description pages for HTTP errors. Custom error
pages may be supplied in the directory specified with the new
configuration statement "error-dir". Error pages can be either
static html files, or files with ".html.var" suffix, providing
language-specific versions of the error texts, negotiatable using
the value of the Accept-Language HTTP header (similar to Apache's
mod_negotiation).
* src/httperr.c: New file.
* src/lang.c: New file.
* src/Makefile.am: Add new files.
* src/catfile.c (catfile_suf_n)
(catfile_suf): New functions.
* src/config.c: New global configuration statement: error-dir.
* src/fileserv.c (http_error): Remove. Reimplemented in src/httperr.c.
(fileserv_handler): Return appropriate HTTP status codes.
* src/fileserv.h: Add include files.
(error_dir): New extern.
(n2realloc)
(catfile_suf_n,catfile_suf)
(http_error,http_log)
(lang_var_list_free,select_language): New protos.
* src/mem.c (nrealloc, n2realloc): New functions.
* src/icon.c: Reorder includes.
* src/idx.c: Likewise.
* src/logger.c: Likewise.
* src/pidfile.c: Likewise.
* src/remoteip.c: Likewise.
* src/runas.c: Likewise.
|
|
* src/catfile.c: Use malloc instead of xmalloc.
* src/config.c (dirconfig): Change signature. Return FSE_ constant.
(config_init): Use calloc instead of xcalloc.
(set_index_files,set_hidden_files): Use nrealloc instead of
xnrealloc.
(all setters): Use string_copy instead of xstrdup.
(config_parse): Return meaningful FSE_ constant.
* src/fileserv.c (fse_to_http_code): New function.
(find_index_files,get_file_resp): Handle out-of-memory
errors.
* src/fileserv.h (fileserv_error): New enum.
(alloc_warn,nrealloc): New protos.
(dirconfig): Change prototype and return value.
* src/mem.c (alloc_warn)
(nrealloc): New functions.
|
|
Move the directory listing code into a separate module. Improve error
reporting in directory index code. Don't bail out on (most of the)
out of memory errors.
* src/dirls.c: New file.
* src/dirls.h: New file.
* src/fileserv.c (errno_to_http_code): Increase resolution.
* src/fileserv.h (parse_template_string)
(parse_template_file): Change return value.
|
|
|
|
* src/idx.c (next_escape_node): Remove unnecessary memory allocation.
|
|
* src/icon.c: New file.
* src/Makefile.am: Add new sources.
* src/catfile.c (catfile_n): Compress trailing slashes in dir,
and remove such in file. This makes sure that the returned value
never ends in slash, which is necessary in particular for lstat
to work correctly.
* src/config.c: New global keywords: name-icon, type-icon and
mime-icon.
* src/defidx.html: Update.
* src/fileserv.h: Update.
* src/idx.c: New expansion command: iconlookup. Rename icon to
iconsrc, and alt to iconalt.
|
|
* src/config.c: New global keyword "index-css"
* src/fileserv.c (urimap_add): Make sure the list is sorted
by uri_len in descending order.
(main): Fix the check for empty mapping list.
* src/fileserv.h (index_css): New extern.
|
|
file.
* src/Makefile.am (AM_CPPFLAGS): Define SYSCONFDIR.
* src/dirconfig.c: Rename to src/config.c. Implement
global configuration file.
* src/fileserv.c: Remove unnecessary options.
* src/fileserv.h: Rewrite configuration-related prototypes and
declarations.
|
|
* src/Makefile.am: Add new sources.
* src/mem.c: New file.
* src/remoteip.c: New file.
|
|
* mimetypes/eval.c (get_file_type): Return "directory",
for directories.
* src/defidx.html: Use $FILETYPE if no icon is available.
* src/idx.c: New variable $FILETYPE.
|
|
|
|
|
|
* src/dirconfig.c (set_index_files): Bugfix.
(dirconfig_keyword): New keyword hidden-files.
(dirconfig_free): Free hidden files regexes.
(filename_is_valid, filename_is_special)
(filename_is_hidden): New functions.
* src/fileserv.c (xnrealloc): New function.
(get_file_resp): Additional checks for allowed filenames.
* src/fileserv.h (xnrealloc): new proto.
(DIRCONFIG): New members: hidden_files_rxv, hidden_files_rxc.
(filename_is_special, filename_is_hidden,filename_is_valid): New protos.
* src/idx.c: Skip hidden files.
|
|
* src/defidx.html: Make query arguments configurable.
* src/fileserv.c (urimap_find_dir): Match exact directory
name, as well as the one followed by sud-directory components.
(get_file_resp): Check for symlinks first.
Pass sorting arguments to directory_index.
* src/fileserv.h (INDEX_SORT_COL, INDEX_SORT_ORD): New datatypes.
(directory_index)
(index_sort_col_from_arg)
(index_sort_col_to_arg)
(index_sort_ord_from_arg)
(index_sort_ord_to_arg): New protos.
* src/idx.c (IDXLIST): Add count member.
(idxlist_init,idxlist_append): New functions.
(idxlist_scan): Append '/' to the names of subdirectories.
(idxlist_qsort): New function.
(index_sort_col_from_arg)
(index_sort_col_to_arg)
(index_sort_ord_from_arg)
(index_sort_ord_to_arg): New functions.
(EVAL_ENV): Add sorting order and column members (ord, col).
(template_command): New commands: updir, sortorder.
(directory_index): Sort the listing.
|
|
* fileserv.c (get_file_name): Rename to get_file_resp;
Determine file type and return it in FILE_RESP.
Make redirect location absolute.
|
|
* src/Makefile.am: Add new sources. Build defidx.h
* src/defidx.html: New file.
* src/dirconfig.c (dirconfig_free): Handle NULL argument.
* src/fileserv.c (index_css, tmpdir): New globals.
(get_file_name): Rewrite.
(fileserv_handler): Rewrite.
* src/fileserv.h (index_css, tmpdir): New externs.
* src/ftoc.sed: New file.
* src/idx.c: New file.
* src/wordsplit.c (expvar): Gracefully handle NULL values in
ENV_KV environment.
* src/wordsplit.h: Fix typo in a comment.
|
|
* src/fileserv.c: Use sys/queue.h to maintain lists. The header (or
its like) will in the future be included in the sources.
(index_file): Remove.
(get_file_name): Rewrite. Take into account directory configuration.
* src/fileserv.h (DIRCONFIG): New data type.
(DIRCONFIG_INITIALIZER): New macro.
(xstrdup)
(dirconfig, dirconfig_parse)
(dirconfig_init, dirconfig_free)
(catfile_n, catfile): New functions.
* src/Makefile.am: Add new sources.
* src/catfile.c: New file.
* src/dirconfig.c: New file.
* src/wordsplit.c: New file.
* src/wordsplit.h: New file.
|
|
requested
* src/fileserv.c (fileserv_handler): Derive the response code from
the system errno.
|
|
* mimetypes/err.c (print_locus_range): Fix output length.
* mimetypes/grammar.y (rule_line): Initialize locus range.
* mimetypes/prloc.c (locus_range_format): Fix memory overrun;
terminate output with null byte.
* src/fileserv.c: New option -i (index page).
|
|
|