Jeff Trawick [Fri, 10 Nov 2000 23:52:18 +0000 (23:52 +0000)]
Get mod_userdir compiling on FreeBSD when APR_HAS_THREADS.
This doesn't account for the fact that getpwnam() isn't
thread-safe on FreeBSD; it also doesn't account for systems
where getpwnam_r lives outside of libc.
See thread with subject "[?PATCH?] using getpwnam_r in mod_userdir"
in Nov. 2000 new-httpd for some better long-term ideas for how to
handle the problem.
Ryan Bloom [Fri, 10 Nov 2000 21:51:10 +0000 (21:51 +0000)]
MM has a bug that when you ask for a specific amount of shared memory
it allocates just that amount. But, MM actually uses some of it, so we
need to over allocate just a bit. On 32 bit machines 40 bytes is enough,
but on a 64 bit machine it isn't. So, we bump it up to 80 bytes until
MM fixes this bug.
Submitted by: David Hill <David.D.Hill@compaq.com>
Just some things I noticed letting someone else have some desktop time.
Guess homework isn't a bad sacrifice, actually read some docs :-)
Correct me if I'm wrong on the mod_auth_digest changes.
Tony Finch [Fri, 10 Nov 2000 01:34:46 +0000 (01:34 +0000)]
In mass hosting setups (using mod_vhost_alias or mod_rewrite) where
the hostname is interpolated into the filename, we need to be sure
that the result of interpolation doesn't expose parts of the
filesystem that should be private. This was done by checking the
syntax of the Host: header according to RFC 1123 and RFC 952. However,
many people have broken configurations that violate this syntax
(frequently because they use underscores in their names), and it also
doesn't accommodate the current effort to internationalize the DNS. I
don't think the former is a compelling reason to relax the syntax
checking, but the latter does justify this change.
The only RFC on internationalized DNS at the moment is RFC 2825 which
is an introduction to how difficult the whole thing is; the other
official documentation is a pile of Internet Drafts produced by the
Internationalized Domain Names Working Group of the IETF (with names
starting "draft-ietf-idn-"). However they have very little to say
about URIs, and the current Internet draft about internationalized
URIs (draft-masinter-url-i18n-05) has very little to say about
hostnames :-( On the gripping hand there is some useful information at
<http://www.apng.org/idns/> where there is some iDNS testbed work
going on. The basic idea is that although the format of the hostnames
in the DNS itself remains compatible with RFC 1123, the actual
hostname presented to the resolver is in UTF8, and therefore the
hostname in the URL and Host: header is also in UTF8.
This change relaxes the checking so that only character sequences that
are sensitive to the filesystem are rejected, i.e. forward slashes,
backward slashes, and sequences of more than one dot.
David Reid [Fri, 10 Nov 2000 00:58:25 +0000 (00:58 +0000)]
Bring the apr_in_addr type into line with naming conventions and make changes
where appropriate. At least on my system virtual hosts seem to still work :)
Ryan Bloom [Thu, 9 Nov 2000 22:05:40 +0000 (22:05 +0000)]
Remove MMAP handling from the default handler. MMAPs are created by the
file_bucket read function now. If we try to read from a file bucket and
it makes sense to convert that bucket to an MMAP, that just happens.
Per new-httpd discussions, this version of mod_autoindex has been set
aside as a test for rputs style backwards compatibility. It has really
horrid chunking charateristics, so it was the ideal nominee for the job.
Please refer to src/modules/standard/mod_autoindex.c for the complete
revision history. When rputs is entirely eliminated (if it ever is)
then this version should be eliminated.
David Reid [Thu, 9 Nov 2000 15:09:50 +0000 (15:09 +0000)]
Change the code to reflect the recent API changes...
Alter http_vhost.c to use the new apr_get_inaddr fucntion. Old code is still
there just in case it breaks. can someone check it who knows this stuff?
Greg Stein [Thu, 9 Nov 2000 12:48:17 +0000 (12:48 +0000)]
one more round of walker cleanup: remove some items that are internal to the
FS provider from the public API; bang up the FS internals for the
now-private items and mechanisms; a bit more revamp to the FS walker
top-level APIs to narrow in on obsoleting dav_walker_ctx.
Ryan Bloom [Thu, 9 Nov 2000 03:00:00 +0000 (03:00 +0000)]
The content-length filter needs to compute the length even if the
content-length has already been set. If we don't, then we won't know if
the content-length has changed because some other filter changed the
length of the actual data. We also ALWAYS want to calculate the content
length if we get the whole brigade in the first call to this function.
Jeff Trawick [Wed, 8 Nov 2000 20:00:35 +0000 (20:00 +0000)]
In the content-length+bytes-sent filter, only set the content length
if we decided to do so initially *and* we've seen all the data.
Prior to this change, for a http/1.1 request to mod_autoindex, the
unconditional call to ap_set_content_length() gave us the wrong
value (only taking into account the first brigade) and disabled
chunking.
David Reid [Wed, 8 Nov 2000 14:47:33 +0000 (14:47 +0000)]
This adds the APR_LOCAL/APR_REMOTE to APR and changes the apr_get/set_port
functions to use it. This is onyl the start and I'll pause a while before
I continue in case people really hate this. The patch can be backed out and
all evidence will be removed, but I think this makes maintaining/developing
the code easier in the long term.
David Reid [Wed, 8 Nov 2000 12:07:27 +0000 (12:07 +0000)]
More cleanup of apr_port_t stuff.
This file will need a lot of work as it's using a lot of "raw" information
from socket structures that won't work with IPv6. Needs to be abstracted out
and use APR instead.
Ryan Bloom [Wed, 8 Nov 2000 06:24:47 +0000 (06:24 +0000)]
The byte-ranges filter. This looks like it should work, but the
Acrobat plug-in doesn't like it for some reason. This does work better
than what we currently have, because at least it returns all of the
requested data. This basically removes all BUFFs from the byte-range
code and removes all of the byte-range code from the default-handler.
Byte-ranges are now handled by a filter, which makes sense, and it allows
us to handle byte-ranges for all requests, not just files.
Ryan Bloom [Tue, 7 Nov 2000 20:21:55 +0000 (20:21 +0000)]
Convert a lot of apr_ssize_t to apr_size_t. We don't ever accept or return
signed values in these integers, and we return the error codes directly,
so we should always report the number of bytes read/written correctly. If
we have an error, that is 0 bytes. If that is true, then using signed
values doesn't make any sense.
Ryan Bloom [Tue, 7 Nov 2000 18:09:47 +0000 (18:09 +0000)]
Remove the original ap_send_fd code. The filters have been working for a
while, and this is cluttering up the code. If it is really needed, it
can be found in CVS
Ryan Bloom [Tue, 7 Nov 2000 00:58:49 +0000 (00:58 +0000)]
Always compute the content-length regardless of whether it is sent to the
client or not. The reason for this, is that it allows us to log the
bytes sent to the client correctly. This also simplifies the
content-length filter a bit, by making it a single pass through the
brigade.
Ryan Bloom [Tue, 7 Nov 2000 00:33:48 +0000 (00:33 +0000)]
Remvoe AP_END_OF_BRIGADE. This definition didn't really mean anything,
because it didn't signify the end of the brigade, and it didn't signify
the end of a response. It ended up meaning flush the data, which can be
detemined with bucket type checks. This also makes the FLUSH and EOS
buckets have a 0 length, which makes a lot of code cleaner, because now we
can just add lengths and be sure they are all >=0.
Ryan Bloom [Mon, 6 Nov 2000 20:43:19 +0000 (20:43 +0000)]
ap_send_fd should not be sending an EOS bucket, so we should remove any
trace of that possibility from the code. First of all, there is nothing
that says you can only send one file bucket in a response, and second,
even if a handler sends a file, nothing says that it can't add text before
or after it too.
Ryan Bloom [Sun, 5 Nov 2000 04:06:17 +0000 (04:06 +0000)]
Allow the core_output_filter to save data in the filter past the end of
the first request if this is a keepalive connection. This allows us to
save the end of the first request until we have enough data from the
second request to make it worthwhile to send the responses. In order
to do this, we need to allocate mmap's from the connection pool instead
of the request pool. If we don't use the connection pool, then the mmap
is freed before the data is sent, because the mmap is freed at the end of
the first request.
Ryan Bloom [Sat, 4 Nov 2000 01:30:37 +0000 (01:30 +0000)]
Clean up blocking and non-blocking reads from buckets. The only bucket
that works correctly right now is sockets, but pipes are coming next.
This also makes the http_header_filter do AP_MODE_PEEK correctly.
Jeff Trawick [Fri, 3 Nov 2000 16:38:28 +0000 (16:38 +0000)]
Change the content-length filter to give up (i.e., not provide content-length)
if it gets a flush bucket. A generator of streaming content needs to send down
a flush bucket (e.g., by calling ap_rflush()) if it wants to send a partial
response to the client immediately.
John's patches to provide depreciated messages for the -i and -u
options (now -k install|uninstall), and best yet, restart the console
mode server on Ctrl+Break (Ctrl+C still stops it.)
At least this is the second half - sorry I missed a bit.
Submitted by: John Sterling <sterling@covalent.net>
Reviewed by: William Rowe
John's patches to provide depreciated messages for the -i and -u
options (now -k install|uninstall), and best yet, restart the console
mode server on Ctrl+Break (Ctrl+C still stops it.)
Submitted by: John Sterling <sterling@covalent.net>
Reviewed by: William Rowe
David Reid [Fri, 3 Nov 2000 02:17:56 +0000 (02:17 +0000)]
We don't really want to fool around with socket structures if we don't have to,
and in this case we can get the ip address directly from the socket. This
should mean that if we add more protocol support we don't have to worry about
this. No doubt this is the first of many such changes...
Bill Stoddard [Fri, 3 Nov 2000 01:31:37 +0000 (01:31 +0000)]
Add a new LogFormat directive, %c, that will log connection
status at the end of the response as follows:
'X' - connection aborted before the response completed.
'+' - connection may be kept-alive by the server.
'-' - connection will be closed by the server.
Ryan Bloom [Thu, 2 Nov 2000 20:33:48 +0000 (20:33 +0000)]
Fix the core_output_filter to work with FLUSH buckets. With this change,
when the core sees a FLUSH bucket, we automatically send everything to the
network.
Two patches (sorry), first to clean up the double assignment of the
r->content_type value on UNICODE_FS, and the second to add ETag and
Modified-Date to the file listing. If anyone sees an objection to
this thing, please scream (loudly) before I go and attack 1.3.x with
the ETag/Modified-Date Friday a.m.
Ryan Bloom [Thu, 2 Nov 2000 18:51:08 +0000 (18:51 +0000)]
Create a feature macro that determines if Autoconf was used to configure
the server. The ap_ugly_hack variable is only valid if Autoconf was used
for the configuration.
Jeff Trawick [Thu, 2 Nov 2000 15:42:56 +0000 (15:42 +0000)]
ap_http_header_filter() can't remove itself until after we the
CHUNK filter has been added. Otherwise, f->next won't be the
CHUNK filter and thus the first brigade won't be chunked
properly.
Reported by: wrowe
Greg Stein [Thu, 2 Nov 2000 03:30:36 +0000 (03:30 +0000)]
Simplify the configuration mechanisms for threading in APR.
Revise how Apache configs APR and allow MPMs (or other config scripts) to
pass cmd line params down to APR. For the MPMs that specifically require
or disallow threads, have them force APR threads on/off.
Submitted by: Joe Orton <joe@light.plus.com>
Reviewed by: Greg Stein
Jeff Trawick [Thu, 2 Nov 2000 02:12:34 +0000 (02:12 +0000)]
Get rid of some warnings on Solaris 8 by using APR's ctype macros:
logresolve.c: In function `main':
logresolve.c:327: warning: subscript has type `char'
ab.c: In function `main':
ab.c:1074: warning: subscript has type `char'
ab.c:1087: warning: subscript has type `char'