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
Greg Ames [Sat, 26 Jan 2002 20:16:01 +0000 (20:16 +0000)]
ap_sub_req_lookup_dirent: fix mod_negotiation loop with near infinite
subrequests
this function has been creating bogus subrequest URIs when there is
path_info for a long time. They didn't matter until fixup_dir started
using them for URI subrequests, which led to a loop with ever growing
bogus internal URIs and filenames.
Ian Holsman [Fri, 25 Jan 2002 20:09:33 +0000 (20:09 +0000)]
I haven't created the optional function to specify the cache_key yet,
That will come after this patch.
ok.. brief summary of whats changed
* new Optional Directives
* CacheMemEntrySize -- max size of a individual entry in memory
cache
* CacheIgnoreNoLastMod - so we can cache mod-included files
* it tries to figure out the size of the request based on buckets if the
content-length header isn't set
* mem_cache now caches the subprocess_env & notes tables
* the CACHE_IN/OUT/CONDITIONAL run at FTYPE_CONTENT+1, so that
all other content filters run BEFORE the cache in.
note: the code is still experimental, and we need a bit more work
mainly...
* garbage collection
* cache stats/reporting
* manual removal of a key.
No. I don't like this patch. I like what it does [shared scoreboard
for Windows, finally] but not how it's implemented.
However it works, and is equally crufty to what already exists for
win32 listeners and other exposed data within scoreboard.c.
To do this right, we need to drop all the external references to data
within the scoreboard, and add an accessor for remaining bits (such as
Win32's need for direct access to the apr_shm_t.) And within Win32,
we need to stack all this _within_ the pre-mpm hook. But those are
missions in and of themselves.
Change ap_get_brigade prototype to remove *readbytes in favor of readbytes.
If you need the length, you should be using apr_brigade_length. This is
much more consistent. Of all the places that call ap_get_brigade, only
one (ap_http_filter) needs the length. This makes it now possible to
pass constants down without assigning them to a temporary variable first.
Also:
- Change proxy_ftp to use EXHAUSTIVE mode (didn't catch its -1 before)
- Fix buglet in mod_ssl that would cause it to return too much data in
some circumstances