Doug MacEachern [Mon, 19 Nov 2001 22:37:57 +0000 (22:37 +0000)]
add input filter AP_MODE_INIT support to handshake before reading
request data from the client.
PR:
Obtained from:
Submitted by: dougm
Reviewed by: wrowe
Doug MacEachern [Mon, 19 Nov 2001 22:36:20 +0000 (22:36 +0000)]
add new input filter mode AP_MODE_INIT:
allows filters such as mod_ssl to initialize a client connection
(ie handshake) before reading request data from the client.
PR:
Obtained from:
Submitted by: dougm
Reviewed by: wrowe
Bill Stoddard [Sat, 17 Nov 2001 07:54:34 +0000 (07:54 +0000)]
Externalize the functions to manage the mpm's queue of completion_contexts.
Now a module can produce to the queue of contexts that the worker threads
consume from.
Aaron Bannert [Fri, 16 Nov 2001 19:24:27 +0000 (19:24 +0000)]
My 2pfennig. I'd like to see more of a technical reason why we should
replace the tried and tested prefork MPM with the newfangled hybrid
threaded/process worker MPM (of which I am one of the more recent
contributors and evangelists).
Aaron Bannert [Fri, 16 Nov 2001 18:28:25 +0000 (18:28 +0000)]
Conversion from old apr_lock_t to new apr_thread_mutex_t
(only converting INTRAPROCESS locks at this time).
I don't see how this used to work, which also means I'm not entirely
sure if it works now. It really didn't look like it was allocating
the correct size before. It compiles and SSL still works in my limited
tests, but I'd appreciate a second opinion.
Ryan Bloom [Thu, 15 Nov 2001 20:55:13 +0000 (20:55 +0000)]
Fix the SSL filter logic. The SSL filter is not a network filter, because
it does not actually do the reading and writing to the network. By
moving that filter to in between CONNECTION and NETWORK filters, we ensure
that SSL is always called before the core.
Ryan Bloom [Thu, 15 Nov 2001 20:49:54 +0000 (20:49 +0000)]
Pull lingering close out of the pool cleanup phase. This was causing too
many bugs. Instead, it is called where it used to be called. I have
abstracted some of the logic out of the lingering close so that it gets
the socket from the connection using the core's conn_config vector. This
is in anticipation of a change to use a hook for the lingering close,
which I hope to do soon.
Ryan Bloom [Thu, 15 Nov 2001 05:05:20 +0000 (05:05 +0000)]
Fix a file descriptor leak in mod_include. When we include a
file, we use a sub-request, but we didn't destroy the sub-request
immediately, instead we waited until the original request was
done. This patch closes the sub-request as soon as the data is
done being generated.
This passes all tests in the test suite.
Submitted by: Brian Pane <bpane@pacbell.net>
Reviewed by: Ryan Bloom and Cliff Woolley
Ryan Bloom [Thu, 15 Nov 2001 04:39:55 +0000 (04:39 +0000)]
FTYPE_CONTENT - 1 isn't enough for OLD_WRITE. OLD_WRITE is a special
filter, and it MUST run absolutely first. To allow other filters a little
space to manuver, I am moving this to FTYPE_CONTENT - 10.
Submitted by: John Sterling <sterling@covalent.net>
Ryan Bloom [Wed, 14 Nov 2001 23:13:27 +0000 (23:13 +0000)]
Port the worker MPM to the new accept model. This has passed every
test in the test suite (except Limit tests). We waste a bit of space
with the listensocks array, which is the exact same as the ap_listeners
list, but we have done that for a while. I'll fix that soon.
Ryan Bloom [Wed, 14 Nov 2001 21:18:47 +0000 (21:18 +0000)]
Get the proxy module compiling again. This is a hack to get past the
current compiler errors. Basically, the core now puts the socket
in the conn_rec->conn_config vector. The proxy grabs that socket and
uses it where it used to use the client_socket field from the conn_rec.
Long-term, all of the direct socket communication needs to be removed,
and this should go through a filter stack. Short-term, this gets the
proxy working again.
I have tested http and connect, but I haven't looked at the FTP proxy,
although it does compile now.
Aaron Bannert [Wed, 14 Nov 2001 18:56:18 +0000 (18:56 +0000)]
Turns out this is causing problems on my linux box (libtool 1.3.5), so
I'm going to remove it until I or someone else can come up with a better
way to check for and link against libssl and libcrypto for mod_ssl.so.
Aaron Bannert [Wed, 14 Nov 2001 07:50:00 +0000 (07:50 +0000)]
Convert tabs to spaces, and a couple other style changes. No functional
changes. I checked with the rewrite.t perl-framework test to make sure
it still passes.
Ryan Bloom [Wed, 14 Nov 2001 00:38:16 +0000 (00:38 +0000)]
Move this to a HOOK_MIDDLE location. We need to add some logic to
make sure that we have a socket that the core controls if we do this,
but it is more correct.
Ryan Bloom [Tue, 13 Nov 2001 22:42:38 +0000 (22:42 +0000)]
Allow modules that add sockets to the ap_listeners list to
define the function that should be used to accept on that
socket. Each MPM can define their own function to use for
the accept function with the MPM_ACCEPT_FUNC macro. This
also abstracts out all of the Unix accept error handling
logic, which has become out of synch across Unix MPMs.
The code flow is much easier now for different transports:
1) During pre-config, post-config or while parsing the config
file, add a socket to the ap_listeners list, making sure to
define an accept function at the same time.
2) MPMs find the correct listener, and call the accept function
that was defined in step 1.
3) That accept function returns a void pointer, which is passed
to the create_connection hook.
4) create_connection adds the correct low-level filters.
Cliff Woolley [Tue, 13 Nov 2001 07:37:13 +0000 (07:37 +0000)]
Fix a bug which would cause the response headers to be omitted
when sending a negotiated ErrorDocument because the required
filters were attached to the wrong request_rec.
Ryan Bloom [Tue, 13 Nov 2001 07:15:36 +0000 (07:15 +0000)]
This allows modules to add socket descriptors to the pollset. I have
only added this to the perfork MPM, and the others work without it.
Tomorrow I will add it to the other MPMs.
Ryan Bloom [Tue, 13 Nov 2001 06:04:25 +0000 (06:04 +0000)]
Remove commas from the end of the macros that define
directives that are used by MPMs. Previous to this patch,
you would use these macros without commans, which was unlike
any other directives. Now, after the macro, you must have
a comma. This makes the macros look more like the rest of the
directives.
I know this is cosmetic, and I was going to leave it alone, but when
I found out that it bothered Cliff too, I decided to fix it after all.
Ryan Bloom [Tue, 13 Nov 2001 02:09:07 +0000 (02:09 +0000)]
Cleanup some code that was created during the abstration. This basically
takes the old ap_new_connection, and puts into the new core_create_conn
function. There is no good reason to have two functions to do this.
Ryan Bloom [Tue, 13 Nov 2001 01:24:42 +0000 (01:24 +0000)]
Remove more network logic from the MPMs. Essentially, each MPM can define
AP_MPM_DISABLE_NAGLE_ACCEPTED_SOCK, which tells Apache to disable_nagle
on the accepted socket.
Ryan Bloom [Mon, 12 Nov 2001 23:49:08 +0000 (23:49 +0000)]
Begin to abstract out the underlying transport layer.
The first step is to remove the socket from the conn_rec,
the server now lives in a context that is passed to the
core's input and output filters. This forces us to be very
careful when adding calls that use the socket directly,
because the socket isn't available in most locations.
Doug MacEachern [Mon, 12 Nov 2001 22:01:14 +0000 (22:01 +0000)]
fix segv triggered by recent ap_lingering_close change
need to set SSLFilterRec.pssl = NULL when ssl_hook_CloseConnection is called
otherwise, ap_lingering_close -> ap_flush_conn will call ssl_io_filter_Output
which thinks it can still use the SSLFilterRec.pssl
PR:
Obtained from:
Submitted by:
Reviewed by:
Jeff Trawick [Mon, 12 Nov 2001 17:50:59 +0000 (17:50 +0000)]
Really reset the MaxClients value in worker when the
configured value is not a multiple of the number of threads
per child. We said we did previously but we forgot to.
Aaron Bannert [Mon, 12 Nov 2001 08:40:33 +0000 (08:40 +0000)]
Keep track of this so I don't forget. Not entirely sure how to go about
doing this properly, but I'll figure it out unless someone else beats
me to it.
Cliff Woolley [Mon, 12 Nov 2001 04:34:13 +0000 (04:34 +0000)]
Port Justin's mod_cgid change to mod_cgi.
mod_cgi wasn't actually broken in the way that mod_cgid was, but
it's still good do have these checks be against APR_SUCCESS rather
than 0 for clarity.
Cliff Woolley [Mon, 12 Nov 2001 03:23:12 +0000 (03:23 +0000)]
Remove the returned-length "w" parameter from apr_bucket_heap_create()
and apr_bucket_heap_make(). It was useless, since the length is invariant
from the length passed in and from the resulting bucket's b->length. This
takes care of a long-standing issue first brought up in February and
discussed on the dev@apr list. (Issue #2 from the "Bucket API Cleanup
Issues" thread.)
See http://marc.theaimsgroup.com/?l=apr-dev&m=98324983126666&w=2
Ian Holsman [Sun, 11 Nov 2001 22:31:04 +0000 (22:31 +0000)]
This patch changes the apr_table_elts macro so that it provides
access to the internals of an apr_table_t via a const pointer
instead of the current non-const pointer.
Submitted by: Brian Pane <BPane@pacbell.net>
Reviewed by: Ian Holsman
Ian Holsman [Sun, 11 Nov 2001 22:12:25 +0000 (22:12 +0000)]
This patch zero-fills just the integer and pointer fields in
the structure, plus the first byte of each of the string buffers.
This updated version of the patch doesn't allocate space for
the error_str and time_str buffers in the mod_include filter
context until/unless they're actually needed.
--Brian
Submitted by: Brian Pane <bpane@pacbell.net>
Reviewed by: Ian Holsman