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'
Jeff Trawick [Wed, 1 Nov 2000 18:42:55 +0000 (18:42 +0000)]
Create the pool bucket after we know the true length, because
(currently) we can't shorten the length of such a bucket by
setting e->length. (We could split and then remove the extra
bucket, but this seems cleaner. We may still want to have a
way to shorten a bucket, but there isn't a pressing need for
that at the moment.)
Joshua Slive [Wed, 1 Nov 2000 18:06:37 +0000 (18:06 +0000)]
Update the main doc page to a two-column format, and add a new section
called "Using the Apache HTTP Server" for task-oriented docs. Also,
remove some of the "other notes" links that are more or less obsolete.
They are still available on a sub-page.
This is a little fancier than the old one, which I know will annoy
some people. Oh well.
The design and HTML coding comes mostly from Carlos, but I messed it
up and changed stuff. Blame Joshua for any errors.
Submitted by: Carlos Ramirez <cramirez@gte.net>, Joshua Slive
Jeff Trawick [Wed, 1 Nov 2000 15:42:50 +0000 (15:42 +0000)]
Fix a buglet in the APR-ization of ap_lingering_close() -- use APR_SO_TIMEOUT
instead of BO_TIMEOUT. (We were actually setting a different socket option.)
Ryan Bloom [Wed, 1 Nov 2000 06:02:22 +0000 (06:02 +0000)]
Fix canned-errors and OPTIONS requests, so that we don't allocate 8k
for the headers. We count the number of bytes we expect to get and only
allocation that many bytes.
Ryan Bloom [Wed, 1 Nov 2000 05:15:25 +0000 (05:15 +0000)]
Stop always allocating 8k for each request. We now count the number
of bytes required for the headers for each request, and we just allocate
that number of bytes plus 100 extra. The extra 100 are a fudge factor,
because it is a bit difficult to compute the exact length for the
basic HTTP headers like date and the status line.
Ryan Bloom [Wed, 1 Nov 2000 00:52:06 +0000 (00:52 +0000)]
Clean up the http filter a lot. Instead of sending a bucket per header,
we now create a single bucket that has all of the headers and send that.
One known issue is that this limits the headers to 8k, but it is a minor
patch to fix that.
This also stops us from exporting ap_send_header_field. This function no
longer makes sense to export.
Jeff Trawick [Tue, 31 Oct 2000 19:59:09 +0000 (19:59 +0000)]
a couple of fixes for byte ranges:
. use %qx format instead of %llx for 64-bit integer (apr_time_t);
%llx prints as "%llx"
. pass offset and length to ap_bucket_create_mmap() so that byte
ranges work with mmaps (at least for a single range)
Ryan Bloom [Tue, 31 Oct 2000 00:47:24 +0000 (00:47 +0000)]
Make mod_cgi and mod_include work when compiled as DSO's again. This is
accomplished by moving suexec out of it's own file and into unixd.[ch].
The problem was that suexec.c wasn't being linked into the server unless
a module was actually using ap_os_create_process. This is still not clean,
but it works now.
Ryan Bloom [Mon, 30 Oct 2000 23:08:27 +0000 (23:08 +0000)]
This is an ugly little hack to allow DSO modules to work. This basically
forces Apache to link in all of the APR functions whether they are used
by any static modules or not.
Jeff Trawick [Thu, 26 Oct 2000 10:48:28 +0000 (10:48 +0000)]
Introduce ap_xlate_proto_{to|from}_ascii() to clean up some of
the EBCDIC support. They are noops on ASCII machines, so this
type of translation doesn't have to be surrounded by #ifdef
CHARSET_EBCDIC.
Jeff Trawick [Wed, 25 Oct 2000 18:54:20 +0000 (18:54 +0000)]
Get rid of the xlate version of ap_md5_digest()
since we don't compute digests of filtered (e.g., translated)
response bodies this way anymore. (Note that we don't do it at
all at the present; somebody needs to write a filter to do so.)
Jeff Trawick [Wed, 25 Oct 2000 17:32:52 +0000 (17:32 +0000)]
On an EBCDIC machine, be willing to translate mod_autoindex-
generated output. Otherwise, it doesn't look too cool.
XXX This isn't a perfect fix because this doesn't trigger us
to convert from the charset of the source code to ASCII. The
general solution seems to be to allow a generator to set an
indicator in the r specifying that the body is coded in the
implementation character set (i.e., the charset of the source
code). This would get several different types of documents
translated properly: mod_autoindex output, mod_status output,
mod_info output, hard-coded error documents, etc.
Jeff Trawick [Wed, 25 Oct 2000 16:49:14 +0000 (16:49 +0000)]
Don't segfault if the filter doesn't have any request config prepared.
This can happen when the config doesn't tell us to do anything but the
administrator coded us in Add{Input|Output}Filter. Instead of segfaulting,
we turn into a noop.