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
apr_file_gets returns an apr_status_t not a char* and it returns
APR_SUCCESS when it reads something (which is 0).
Two of the cases were doing while apr_file_gets > 0 which would cause
it to loop when it returned APR_EOF. So, the valid check here is to
loop while we are receiving APR_SUCCESS.
Fix all of the other apr_file_gets to check APR_SUCCESS explicitly so
that it is obvious that we are checking an apr_status_t. Yes,
0 == APR_SUCCESS, but it obviously wasn't clear to someone what it
was returning.
Ryan Bloom [Sat, 10 Nov 2001 21:07:13 +0000 (21:07 +0000)]
Fix the Windows MPM. Windows doesn't always use the lingering close
function. If it can re-use the socket, we are better off not calling
the function. To fix this, we re-expose the lingering_close function,
and we allow the MPM to remove the cleanup.
Ryan Bloom [Sat, 10 Nov 2001 18:26:30 +0000 (18:26 +0000)]
Remove ap_lingering_close from all of the MPMs. This is now done as
a cleanup registered with the connection_pool. I have also turned
ap_lingering_close into a static function, because it is only used
in connection.c. This is the next step to consolidating all of the
socket function calls. ap_lingering_close will only be added if the
core is dealing with a standard socket.
Stat, don't lstat the final target. This means we may double-stat the
final target file if check for symlinks reveals it's an APR_LNK, but this
is preferable to the convoluted code required to 'reuse' the original stat.
Reintroduce the 'one stat dir_walk', with singificantly more sensible
behavior than the old path_info logic.
If the stat() of r->filename succeeds ignore every segment that requires
no symlink check (and on Win32/OS2/Netware the name matches the canonical
name, assuring us that the case/aliases match the true name.)
This optimization can be improved by establishing a second cache of the
actual partial filenames that _are_ tested for symlinks (or canonical
filename case), and then skiping such tests when the conditions match on
successive passes for subrequests or redirects.
Clean up the declarations and comments of some of the variables in
ap_get_client_block.
There were two len_read vars (each of different types), so the outer one
was shadowed - move it to the correct scope.
Move apr_bucket* old declaration inside of the loop so it is obvious
what its scope is.
Martin Kraemer [Thu, 8 Nov 2001 14:29:37 +0000 (14:29 +0000)]
Fixed previous patch to reflect what Apache-1.3 did regarding self-
referential uri's, and updated the manual accordingly.
XXX There is a kludge here: XXX the port number from the client's Host:
header used to be tossed, and there is no clean mechanism to pass it
(in the request_rec) to other consumers. As the unparsed_uri structure
(which could avoid repeated parsing of URI, Host, Port etc) seems to be
mostly unused currently, I used that to pass the port.
Martin Kraemer [Thu, 8 Nov 2001 12:34:21 +0000 (12:34 +0000)]
When no port is given in a "ServerName host" directive, the
server_rec->port is now set to zero, not 80. That allows for
run-time deduction of the correct server port (depending on
SSL/plain, and depending also on the current setting of
UseCanonicalName). This change makes redirections
work, even with https:// connections. [Martin Kraemer]
David Reid [Thu, 8 Nov 2001 00:54:00 +0000 (00:54 +0000)]
This doesn't feel quite right, but it doesn't cause any problems
and stops an irritation about the standard conf file for
BeOS which barfs if the User/Group is present.
Submitted by: Brad Froehle <epEnochRoot@yahoo.com>
Reviewed by: David Reid <dreid@apache.org>