Greg Ames [Thu, 31 Jan 2002 19:54:53 +0000 (19:54 +0000)]
fix redirects for directories. fixup_dir was munging the URI before other
fixup hooks (such as fixup_redir in mod_alias) had a chance to redirect
the original directory URI.
Bradley Nicholes [Thu, 31 Jan 2002 19:21:34 +0000 (19:21 +0000)]
Removed the call for now to shutdown the listeners so that threads don't end
up stuck on blocking socket calls during shutdown. I need to figure out a
cleaner way of preventing this problem.
Martin Kraemer [Thu, 31 Jan 2002 14:48:51 +0000 (14:48 +0000)]
Add MDTM support if supported by the FTP server, and if either
timegm() exists or struct tm has a tm_gmtoff field (needed for
easily converting the time string to a GMT timestamp).
Escaping for ftp path arguments now uses a dedicated escaping
routine (in order to only escape globbing characters, not all
shell meta characters).
Execute the SIZE query with the same TYPE setting as the RETR transfer,
because the SIZE may be calculated differently for ASCII files.
The missing xcopy's <.a bit was a showstopper, but to ensure any win32
command.com/cmd.exe lives with us, add the <.y for all copy commands
where the file could already exist.
Martin Kraemer [Wed, 30 Jan 2002 22:41:59 +0000 (22:41 +0000)]
Eliminate variables where unneeded; move ";type=" checking code to front;
drop redundant log messages (covered by proxy_ftp_command());
do checks for /%2f as in apache-1.3.24;
escape path argument in SIZE command
Ryan Bloom [Wed, 30 Jan 2002 22:35:57 +0000 (22:35 +0000)]
Change the Windows MPM to only use the pre_mpm phase in the parent process.
The child processes use the child_init phase to reattach to the shared
memory. This makes Windows work like Unix, which should make it easier
for module authors to write portable modules.
Martin Kraemer [Wed, 30 Jan 2002 15:12:57 +0000 (15:12 +0000)]
Describe the proxy_ftp changes:
FTP directory listings are now always retrieved in ASCII mode.
The FTP proxy properly escapes URI's and HTML in the generated
listing, and escapes the path components when talking to the FTP
server. It is now possible to browse the root directory by using
a url like: ftp://user@host/%2f/ (ported from apache_1.3.24)
Also, the last path component may contain wildcard characters
'*' and '?', and if they do, a directory listing is created instead
of a file retrieval. Example: ftp://user@host/httpd/server/*.c
Martin Kraemer [Wed, 30 Jan 2002 15:07:48 +0000 (15:07 +0000)]
Port the "squid %2f hack" from apache_1.3.24.
It is now possible to browse the root directory by using a url
like: ftp://user@host/%2f/
Also, the last path component may contain wildcard characters
'*' and '?', and if they do, a directory listing is created instead
of a file retrieval. Example: ftp://user@host/httpd/server/*.c
Martin Kraemer [Wed, 30 Jan 2002 14:54:18 +0000 (14:54 +0000)]
For the ftp commands CWD and RETR, do escaping for the path elements,
because FTP servers do globbing, which we do not want for filenames
from the directory listing.
PR:
Obtained from:
Submitted by:
Reviewed by:
Martin Kraemer [Wed, 30 Jan 2002 09:47:22 +0000 (09:47 +0000)]
Simplify the complexity by using a common proxy_ftp_command() routine.
Strip the ";type=X" suffix from the header generated in dir listings.
Set type to ASCII for directory listings. Use common get_PWD() routine.
Brian Pane [Wed, 30 Jan 2002 06:33:18 +0000 (06:33 +0000)]
Added logic to the worker MPM to skip the poll before accept
if there's only one listener socket (based on the implementation
in the prefork MPM). This also enables us to do single-listener
unserialized accept
Simplify the exit paths of ap_rgetline by creating a second brigade for
use when we do AP_MODE_SPECULATIVE. This allows us to delete the
brigades earlier.
(In practice, it really doesn't matter if we delete the brigade or not
since it will be destroyed when it's pool is destroyed, but we'll try
to be nice.)
Bill Stoddard [Tue, 29 Jan 2002 19:02:04 +0000 (19:02 +0000)]
This patch restores most of Ryan's patch (11/12/2001) to remove the
client_socket from the conn_rec. Diffs from Ryan's patch include:
- rename the create_connection hook to install_transport_filters
- move the point of invocation of the hook till after the call to
after ap_update_vhost_given_ip to enable the hook to use vhost
config info in its decision making.
BuildBin never made it to this home. Makefile.win got lost, since it
would have been invoked from another path, trying to validate that the
apr and apr-util repositories had been checked out. Too much trouble :)
By popular demand and some of my own observations - here is a build
target one can use as a dummy, without 'installing binaries'. Now
Win32's makefile.win will simply kick off BuildBin and let it fire
off all the targets from a command line build. This will help to
resolve some of the misses on incremental builds.
Martin Kraemer [Tue, 29 Jan 2002 17:56:42 +0000 (17:56 +0000)]
If the ftp proxy could not guess the output format of the ftp server's
directory listing, it makes another attempt: it tries a format similar to
the output of "ls -s1" (optional whitespace followed by size, followed by
whitespace, followed by filename, where filename may contain no more whitespace).
This format works at least with one FTP server for which previously only
the (non-clickable) output was displayed.
Martin Kraemer [Tue, 29 Jan 2002 17:07:26 +0000 (17:07 +0000)]
Fix handling of \r\n at the end of FTP directory listings (\r characters
were left in the output and would create additional line breaks in most
browsers)
Martin Kraemer [Tue, 29 Jan 2002 15:31:28 +0000 (15:31 +0000)]
* Prefer compatibility with both HTML-4 and XHTML (rather than XHTML only)
* Properly escape URIs and HTML in the FTP filename list
* Avoid a pointer underrun
Jeff Trawick [Tue, 29 Jan 2002 04:54:05 +0000 (04:54 +0000)]
Don't let the default handler try to serve a raw directory. At
best you get gibberish. Much worse things can happen depending
on the OS.
This can happen when autoindex isn't loaded.
On AIX, I had a directory file which was reported to be 1536 bytes
in size. mmap() failed so we went to the fall-back logic.
The first read() got 624 bytes and the next read() got 0
(supposedly EOF). This confused us greatly, we kept allocating
buffers and reading and exercised the paging space.
Aaron Bannert [Tue, 29 Jan 2002 02:41:46 +0000 (02:41 +0000)]
Take advantage of the new pre_config return value when apr_proc_detach
fails. I'll be making some changes to apr_proc_detach, and it will be
nice to be able to report runtime errors.
Tested on worker but the code changes are identical on other MPMs.
Aaron Bannert [Tue, 29 Jan 2002 00:00:39 +0000 (00:00 +0000)]
I think this was supposed to have been bumped a couple times since
the 14th, and was perhaps forgotten about? In any case, it needs to
be bumped now -- pre_config hook return type has changed.
Jeff Trawick [Mon, 28 Jan 2002 18:30:07 +0000 (18:30 +0000)]
Fix some unix socket descriptor leaks in the handler side of
mod_cgid (the part that runs in the server process). Whack a
silly "close(-1)" in the handler too.
Bill Stoddard [Sun, 27 Jan 2002 12:52:08 +0000 (12:52 +0000)]
Remove the create_connection hook and put the client_socket back into the
conn_rec. The create_connection_hook has a design flaw that prevents it
from making decisions based on vhost information.
Shortcut where the resource has no language [discovered with no
DefaultLanguage in cgi-bin, resolving Greg Ames' observations, we
had a lurking segfault.]
This begs the question, what exactly did the fn do with no language
in terms of serving content back in 1.3. Should be reviewed.
Which PR? I can't count them all. Get QUERY_STRING and PATH_INFO
working again. Also rounds out our fix to work around negotiated
directories which Greg Ames fixed; this addition in request.c simply
shortcuts all further processing.
Brian Pane [Sun, 27 Jan 2002 07:30:02 +0000 (07:30 +0000)]
Fixed a read from a deleted brigade in the new version of
ap_rgetline()...
In the "folding" case, there was an ap_get_brigade() call after
the brigade had been destroyed. I noticed this while debugging
a memory leak that showed up while testing the httpd with ab.
Brian Pane [Sun, 27 Jan 2002 01:54:54 +0000 (01:54 +0000)]
Added new functions ap_add_input_filter_handle() and
ap_add_output_filter_handle()
There are many places in the core modules where we do
ap_add_input_filter() or ap_add_output_filter() on a
hardcoded filter name (e.g., "CORE" or "BYTERANGE").
This requires a string-to-filter mapping that wastes
CPU time. (Even though the string lookup uses a trie
for speed, it still ranks as a big consumer of CPU time
because of the large number of filters added per request.)
The new ap_add_*_filter_handle() functions will allow
us to skip the string-to-filter mapping in cases where
the module adding the filter happens to have the
ap_filter_rec_t* for the registered filter (e.g., because
it's the same module that registered the filter in the
first place).
Jeff Trawick [Sat, 26 Jan 2002 23:01:31 +0000 (23:01 +0000)]
ap_rgetline(): completely ignore an empty bucket... previously the logic
generally worked but with a memory debug build it could
crash since some memory debuggers don't like an alloc of
zero bytes