Tony Finch [Sat, 9 Sep 2000 01:11:15 +0000 (01:11 +0000)]
Fix inserting elements at the head and tail of a ring when the ring is
empty. Avoiding referring to the element type in the macros resulted
in some double dereferences that did the wrong thing.
Reported by: Jeff Trawick
Add an index of modules "by type". The modules directory in 2.0
could use a good cleaning to get rid of stuff that doesn't need
to be carried over, but that can wait.
Ryan Bloom [Fri, 8 Sep 2000 20:34:33 +0000 (20:34 +0000)]
Fix a compile break in mod_mime_magic.c. In early 2.0 versions, we would
get a pipe back from create_child, and stuff that into a buff to read from
it. This made sense in 1.3, because we got a buff back from the
create_process call. In 2.0, we are getting a pipe, so this doesn't
make sense. This patch just uses the pipe that is returned to us to read
the information we want.
Submitted by: John K. Sterling <sterling@covalent.net>
Reviewed by: Ryan Bloom
Change prefork to use the same listen api as the rest of the unix mpms
(ap_setup_listeners). This eliminates the need to force a recompile of
listen.c when you switch to/from using prefork.
Tony Finch [Fri, 8 Sep 2000 10:16:14 +0000 (10:16 +0000)]
Reduce the manualarity of managing bucket brigade lists by using the
new AP_RING macros. Most of this commit is fairly pedestrian as you
would expect, but I had to redo the chunking filter because of the
amount of pointer juggling it did. I have done some minimal testing
of this patch and it seems to work.
Jeff Trawick [Thu, 7 Sep 2000 23:51:36 +0000 (23:51 +0000)]
Fix merging of AddDefaultCharset directive.
PR: 5872 (reported against 1.3)
Submitted by: Jun Kuriyama <kuriyama@imgsrc.co.jp>
Reviewed by: Jeff Trawick
Ryan Bloom [Wed, 6 Sep 2000 14:02:29 +0000 (14:02 +0000)]
Fix the ScanDoc output on IE. I don't have IE, so I can't test this, but
it looks correct, and this problem has been submitted to me multiple times
PR: 6501
Submitted by: Shuichi Kitaguchi <ki@hh.iij4u.or.jp>
Reviewed by: Ryan Bloom
Jeff Trawick [Wed, 30 Aug 2000 21:15:33 +0000 (21:15 +0000)]
fix a few bugs and improve error handling:
introduce extended error status as a start of more helpful error logging;
instead of aborting the process when we get a bucket-straddling char too
wide to handle, trace the problem and return an error;
when we get to the end of the brigade and we're still waiting for the rest
of a character, return an error instead of ignoring the problem;
if we get 0 bytes when reading from a pipe, don't fret (segfault); skip
over this empty bucket and read the next one;
don't set done if send_downstream() returns APR_SUCCESS; set it for the
opposite condition; that bug kept us from processing our entire input
brigade for brigades that caused lots of output;
Ryan Bloom [Tue, 29 Aug 2000 22:16:45 +0000 (22:16 +0000)]
Modify the way filters are added to the server. Instead of using a FIFO,
we use a modified LIFO. It is modified, because if we add a filter while
in the middle of another filter, the added filter gets put in after the
current filter. This requires that the server is smart about which filters
are added when. This should be handled by the HTTP protocol, but we will
want to keep and eye on things for a little while.
This change is necessary, because currently when we add a filter it goes
after the last filter of the same type. This is broken whenever we want
to add a filter that has a dependancy. Think about the core and chunking
filters. They are of the same type, and core is always added first. When
we go to insert chunking, it gets added, but it is never called.
Jeff Trawick [Mon, 28 Aug 2000 20:36:42 +0000 (20:36 +0000)]
Update chunk_filter to handle buckets with unknown length (e.g., pipes).
As soon as we hit such a bucket, we'll read from it then pass everything
we have so far on to the next filter. At that point we'll start over.
Also, increase the size of the chunk header buffer to handle larger
lengths.
Note: There is still an extra final chunk header (0) when mod_cgi is used
because EOS is coming down twice.
This is likely to have some bugs here and there. Even worse, it is butt
ugly and in need of simplification.
Jeff Trawick [Sat, 26 Aug 2000 19:45:15 +0000 (19:45 +0000)]
Call ap_pass_brigade() *before* soaking up stderr. The normal CGI
is going to write a bunch of stuff to stdout and nothing to stderr.
Reading stderr before processing the stdout pipe can cause deadlock if
the CGI fills the kernel buffer for stdout because the CGI will stall
writing to stdout while the httpd process will stall reading from the
CGI's stderr.
The NPH CGI behavior was unchanged. If this is still a problem for NPH
CGIs, it was a problem before filtering too.
Also, get rid of a couple of unused variables in cgi_handler.
Ryan Bloom [Fri, 25 Aug 2000 22:18:15 +0000 (22:18 +0000)]
Make CGI's use bucket brigades. This will only work with mod_cgi for the
time being. The changes should apply equally to mod_cgid, but I haven't
had a chance to really try it yet. This is definately sub-optimal as far
as performance is concerned. The concepts are there, and the flags are
available for performance tuning, but I didn't want to really get too
enmeshed in it today.
Jim Jagielski [Wed, 23 Aug 2000 23:28:54 +0000 (23:28 +0000)]
We need to test specifically for setrlimit/getrlimit instead of
just the structure or the RLIMIT_* defines. Also, we should make
the API function unixd_set_rlimit() ``available'' even if it
doesn't do anything.
PR:
Obtained from:
Submitted by:
Reviewed by:
Ryan Bloom [Wed, 23 Aug 2000 00:01:58 +0000 (00:01 +0000)]
Remove IOLs from Apache. They are no longer necessary, now that we have
filtering beginning to work. There is a hack that has been repeated
through this patch, we morph a pipe into a socket, and put the socket
into the BUFF. Everytime we do that, we are working with a pipe from
a CGI, and we should be creating a pipe bucket and passing that bucket
back. Because we don't actually have pipe buckets yet, we are using this
hack. When we get pipe buckets, this will be fixed.
Jeff Trawick [Tue, 22 Aug 2000 18:01:47 +0000 (18:01 +0000)]
Fix charset translation breakage on EBCDIC machines... the core turned
on buff's translation by default, but mod_charset_lite (when configured
to do so) turned on its own filter-based translation, resulting in
gibberish.
To be determined... whether or not mod_charset_lite should enable
translation of text objects by default (a la 1.3)... probably... for
now you have to tell mod_charset_lite to translate.
Ryan Bloom [Tue, 22 Aug 2000 04:25:36 +0000 (04:25 +0000)]
Finish fixing the pcre build. PCRE's configure script should be called,
and we can't clean config.h and then touch the file, we actually need
some of the data that config.h contains.
Bill Stoddard [Tue, 22 Aug 2000 03:20:44 +0000 (03:20 +0000)]
Win32: function pointers use C calling convention unless explicitly set to use
stdcall. The 'split' function pointer in ap_buckets.h points to both static functions
(which use C calling convention) and exported functions (which normally use stdcall).
Let's settle on using the C calling convention.
Bill Stoddard [Tue, 22 Aug 2000 01:24:07 +0000 (01:24 +0000)]
Win32: Reset the acceptex context on a GetQueuedCompletionStatus() failure. We were
losing contexts before this fix, and if we lost enough, the server would stop responding.
GetQueuedCompletionStatus can fail with ERROR_NETNAME_DELETED when a client closes
its end of a connection and we try to reuse the accept socket. Really bizzare... I would
have thought the AcceptEx using the recycled socket would have failed instead...
Jeff Trawick [Sun, 20 Aug 2000 03:44:20 +0000 (03:44 +0000)]
Use context data, initialized prior to insertion of the filter, to indicate
which translation handle to use. This will allow the same filter to work
for input and output.
Tony Finch [Sat, 19 Aug 2000 06:04:57 +0000 (06:04 +0000)]
Add generic support for reference-counting the resources used by
buckets, and alter the HEAP and MMAP buckets to use it. Change
the way buckets are initialised to support changing the type of
buckets in place, and use it when setting aside TRANSIENT buckets.
Change the implementation of TRANSIENT buckets so that it can be
mostly shared with IMMORTAL buckets, which are now implemented.
Jeff Trawick [Fri, 18 Aug 2000 15:33:08 +0000 (15:33 +0000)]
Tweak apache/apr builds to support dsos on OS/390.
The OS/390 compile options are hard-coded because we need the
special DLL,EXPORTALL on *all* object files that are part of the
core so that dsos can reference symbols in the core. (Of course,
we use the option on more object files than that, but it doesn't
seem to hurt anything.)
We hard-code the enablement of DSOs on OS/390 because the
library functions on OS/390 to manage explicit loading are not
portable, so there seems to be no use in probing for them.
Ryan Bloom [Fri, 18 Aug 2000 04:50:22 +0000 (04:50 +0000)]
proxy_cache.c was still in the ApacheModuleProxy project, although that
modules is deprecated. Remove it from the project.
Submitted by: Bill Rowe <wrowe@apache.org>
Ryan Bloom [Fri, 18 Aug 2000 04:46:07 +0000 (04:46 +0000)]
Fix chunking. Two bugs fixed.
1) don't put the trailing 0\r\n\r\n in lenstr; that buffer is
already in use (pointed to by another transient bucket); using
lenstr again overlays that other chunk header
2) insert the bucket with the trailing "0\r\n\r\n" *before* the eos bucket
Submitted by: Jeff Trawick <trawickj@bellsouth.net>
Ryan Bloom [Thu, 17 Aug 2000 14:54:28 +0000 (14:54 +0000)]
Mod_echo was using raw args instead of a flag to enable and disable
itself. I believe this is what was causing the module to not be able to
be enabled and disabled on a per-server basis. This patch makes it use
a flag
Ryan Bloom [Thu, 17 Aug 2000 00:54:03 +0000 (00:54 +0000)]
A first pass at the chunking filter. This is incredibly simple. As
bucket brigades are sent to this filter, it inserts the chunking header
at the front of the brigade. When the filter sees an EOS bucket, it
adds the 0 chunking trailer.
Ryan Bloom [Thu, 17 Aug 2000 00:50:34 +0000 (00:50 +0000)]
Make ap_add_filter use a LIFO stack instead of a FIFO queue to add filters
to the filter stack. This makes the chunking filter work. Without this,
the core_filter is installed in the insert_filters hook, when we get
to the ap_send_http_headers function, we insert the chunking filter, but
it has been installed after the core_filter. This means the chunk_filter
is never called.
This reverses this. The core_filter is installed in the insert_filters
hook, and we put the chunk_filter in during ap_send_http_headers. This
time, the chunking filter is installed before the core_filter, and it
gets called correctly.
Greg Stein [Wed, 16 Aug 2000 19:28:27 +0000 (19:28 +0000)]
Ryan's recent, suggested patch in this area pointed out that we were
missing the needed comparison on the request. this allows subrequests to
insert filters properly (by stopping the scan before transitioning to
the parent request's filters)
Bill Stoddard [Tue, 15 Aug 2000 12:47:46 +0000 (12:47 +0000)]
Remove the sendfile_handler (was #if 0'ed out) that does the buffer hi-jack
trick in order to send the headers out on the sendfile call. Besides, BUFF is
going away with brigades and filters...
Ken Coar [Mon, 14 Aug 2000 21:33:27 +0000 (21:33 +0000)]
Make compilable on Windows again. I'm not sure the x = { [1] = 1 }
syntax is even ANSI C, but it originally compiled for me. Oh, well.
I'd rather have this statically built at compile time, but I don't
want to add the dependencies on the method order and its being
a contiguous sequence.
Jeff Trawick [Mon, 14 Aug 2000 17:50:02 +0000 (17:50 +0000)]
When ap_register_filter() registers a cleanup function, specify
apr_null_cleanup() instead of NULL to indicate that no child
cleanup is desired. (With NULL, we branch to zero.)
Ryan Bloom [Mon, 14 Aug 2000 04:32:00 +0000 (04:32 +0000)]
Fix a minor bug in the default template file. The template used to not
escape the spaces in file names. It does now. This also adds the default
template for Apache to use.
Ryan Bloom [Sat, 12 Aug 2000 23:59:13 +0000 (23:59 +0000)]
Add an error condition to the filter code. Basically, if somehow we get
to the very bottom of the filter stack and nobody has written anything to
the network, then we need to return an error.
Ryan Bloom [Sat, 12 Aug 2000 18:45:35 +0000 (18:45 +0000)]
Initial Filtering code. This uses a bucket brigade scheme to allow modules
to add and modify data while processing a request. The docs still need
to be updated, and a simple html page needs to be created explaining all
of this.
The only filter currently in the code is the core filter. This filter
takes a bucket brigade and writes it to the network through the buff
structure. In time, the buff will go away completely.
More filters will need to be written.
Submitted by: The Apache Community
Reviewed by: The Apache Community