Parent Directory
|
Revision Log
| Links to HEAD: | (view) (annotate) |
| Sticky Revision: |
Introduce a new set of APIs to allow MPMs to be proper modules instead of integral parts which share global variables, functions, and macros with the rest of httpd. Converted now: prefork, worker, event, simple, WinNT* *WinNT hasn't been built or tested, and relies on a hack to include the WinNT mpm.h to disable Unixy MPM support routines in mpm_common.c
Remove all references to CORE_PRIVATE.
update license header text
Update the copyright year in all .c, .h and .xml files
No functional Change: Removing trailing whitespace. This also means that "blank" lines consisting of just spaces or tabs are now really blank lines
No functional change: simple detabbing of indented code.
* server/connection.c (ap_lingering_close): Cleanup; no functional change.
* server/connection.c (ap_lingering_close): Fix lingering close to really match the 1.3 behaviour: read from the client for up to ~30 seconds in total. Current behaviour will attempt only 15 read() calls then give up. PR: 35292
Update copyright year to 2005 and standardize on current copyright owner line.
general property cleanup
* server/connection.c (ap_flush_conn): Fix typo.
Send the 'Close Alert' message to the peer upon closing a SSL session. This required creating a new EOC (End-Of-Connection) bucket type to notify mod_ssl that the connection is about to be closed. Reviewed by: Joe Orton, Justin Erenkrantz
fix name of The Apache Software Foundation
fix copyright dates according to the first check in
apply Apache License, Version 2.0
update license to 2004.
switch to APR 1.0 API (which is still in flux) because of the changes to the argument lists of apr_mmap_dup and apr_socket_create, 2.1-dev won't build with apr and apr-util's 0.9 branch anymore
Apache hooks return int: so s/apr_status_t/int/ PR: Obtained from: Submitted by: Reviewed by: trawick
check the return value of ap_run_pre_connection(). So if the pre_connection phase fails (without setting c->aborted) ap_run_process_connection is not executed. PR: Obtained from: Submitted by: Reviewed by: trawick, jim
finished that boring job: update license to 2003. Happy New Year! ;-))
http occurances to update for apr_socket_opt_get/set
Timeout/time fixes
BUCKET FREELISTS Add an allocator-passing mechanism throughout the bucket brigades API. From Apache's standpoint, the apr_bucket_alloc_t* used throughout a given connection is stored in the conn_rec by the create_connection hook. That means it's the MPM's job to optimize recycling of apr_bucket_alloc_t's -- the MPM must ensure that no two threads can ever use the same one at the same time, for instance.
forgot the actual change PR: Obtained from: Submitted by: Reviewed by:
Update our copyright for this year.
Sander's Stylistic Submission (de-tab) PR: Obtained from: Submitted by: Reviewed by:
Remove the install_transport_filters hook. The same function can be acheived with the pre_connection hook. I have added the socket to the pre_connection phase to make this possible. Reviewed by: Bill Stoddard
Reintroduce the create_connection hook. This hook is required to enable modules to completely take over all network i/o from the core.
This patch restores most of Ryan's patch (11/12/2001) to remove the client_socket from the conn_rec. Diffs from Ryan's patch include: - rename the create_connection hook to install_transport_filters - move the point of invocation of the hook till after the call to after ap_update_vhost_given_ip to enable the hook to use vhost config info in its decision making.
Remove the create_connection hook and put the client_socket back into the conn_rec. The create_connection_hook has a design flaw that prevents it from making decisions based on vhost information.
The connection can be aborted in the preconnection hook. If that happens, there is no need to run the process_connection hook.
Change core code to allow an MPM to set hard thread/server limits at startup.
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.
Add the server_rec argument back to the create_connection hook. Submitted by: Greg Stein
Back out my last patch. The logic to add sockets to pollsets is back in the MPM
Whoops, wrong variable.
I accidentally removed these lines. Thank to Greg for catching this.
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.
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.
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.
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.
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.
The read() in apr_recv() would always be called first and return EAGAIN. This one change to eliminate the read unless there are really bytes to read is good for a 7 to 9% performance boost on AIX.
scratch an old itch - give lingering close its own state in the scoreboard. clean up SERVER_ACCEPTING and SERVER_QUEUEING (never set) while I'm at it.
Add the AP_DECLARE()/AP_CORE_DECLARE macros on the return types of functions used by mod_proxy for export in DLL Submitted by: Ian Holsman <IanH@cnet.com> Reviewed by: Chuck murcko
Move more code from the http module into the core server. This is core code, basically the default handler, the default input and output filters, and all of the core configuration directives. All of this code is required in order for the server to work, with or without HTTP. The server is closer to working without the HTTP module, although there is still more to do. I tried to fix Windows, but somebody should probably make sure I did it correctly.
Update copyright to 2001
Move the call to set the socket timeout outside the loop. ve :
Fix lingering close (and make it more efficient). We were blocking on apr_read() for 30 seconds for each lingering close. What we want to do is block for 2 seconds. If we do not read any bytes from the client in that time, close the connection. If we do read bytes, then wait 2 more seconds to see if more arrive, etc. Repeat for MAX_SECS_TO_LINGER if needed. This should clear the way to get 2.0 running on apache.org!
Start getting extended status working again.
This is the wrong place to mark the server ready. Servers need to be marked ready in the MPM -after- lingering close processing. This could be playing havoc with perform_idle_server_maintenance.
Begin to move the code that updates the child status out of the MPMs and into the main-line code. This ensures that all MPMs can easily forget about updating their status.
*) continued header revamping *) torch some headers (and some libs) from the autoconf stuff
renaming various functions for consistency sake see: http://apr.apache.org/~dougm/apr_rename.pl PR: Obtained from: Submitted by: Reviewed by:
Bring mod_status for 2.0 back in line with mod_status for 1.3. This is basically a straight port of the 1.3 module to 2.0. The MPMs need to be modified a bit to work with mod_status, but prefork, mpmt_pthread, and dexter have already been changed. I will fix perchild tonight. There is a lot of common code that can be abstracted, and there seems to be a small bug with regard to what mpmt_pthread and dexter report as current connections. ExtendedStatus does work again, although until the bug mentioned above is fixed, it isn't as useful on mpmt_pthread and dexter. Next week, I will look at allowing other modules to add data to the STATUS page and possibly to the scoreboard itself.
handle a TCP connection reset between the time we accept the connection and when apr_get_sockaddr() does getsockname() or getpeername() this change will be rolled into the other MPMs later
The fast fix to get FirstBill back out of the gate. It brings up an issue I'll address to the list.
By popular review
The big change. This is part 3 of the apr-util symbols rename, please see the first commit of srclib/apr-util/include (cvs apr-util/include) for the quick glance at symbols changed.
Simplify the lingering close logic a bit. Doesn't actually change anything, this just removes a duplicate call to ap_flush_conn.
The local_addr and remote_addr fields in the conn_rec are now apr_sockaddr_t * instead of sockaddr_in. This is a small step towards IPv6 support.
Get rid of ap_new_apr_connection(). ap_new_connection() now has fewer parameters: the local and remote socket addresses were removed from the parameter list because all required information is available via the APR socket. I haven't tested the most important part -- the WinNT MPM changes -- but it compiles and it looks okay :) If the WinNT MPM works on Win98 these days let me know.
Stop referencing apr_get_socket_inaddr(), apr_get_remote_name(), and apr_get_local_name(). They have been removed.
updates to changed interfaces to apr_set_port(), apr_get_port(), apr_set_ipaddr(), and apr_get_ipaddr()
Clean up some timeout arg warnings
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?
Remove BUFF from the main server. :-) The buff code needs to remain as a part of the server until the proxy is purged of BUFF however.
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.
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...
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.)
Make lingering close access the socket directly, instead of relying on BUFF. This has been tested, but all we can determine is that it doesn't fail, not that it works. This needs to be tested much better.
Get rid of a couple of buff-isms -- setting the B_EOUT flag in a couple of places and doing ap_bread() in ap_lingering_close.
Change some of the BUFF calls to direct calls to the socket.
This begins to remove BUFF from the server. The idea is to go very slowly with this. To begin with, we store both the socket and the BUFF in the conn_rec. Functions are free to use which ever they want, in the end all of the data goes to the same place. This modifies all of the MPMs except Windows. All of the Unix MPMs are working, but the others need to be tested.
Renamed all MODULE_EXPORT symbols to AP_MODULE_DECLARE and all symbols for CORE_EXPORT to AP_CORE_DECLARE (namespace protecting the wrapper) and retitled API_EXPORT as AP_DECLARE and APR_EXPORT as APR_DECLARE. All _VAR_ flavors changes to _DATA to be absolutely clear. Thank you Greg, for the most obvious suggestion.
Add the first draft of the http_filter. In time this filter will split the bucket brigade between the headers and the body. Right now it just converts \r\n to \n\0.
Add a bit of infrastructure which will be needed for input filtering: 1) separate filter lists hanging off the r and the c requests start off with the same filter list as the connection the input filter list is not initialized for subrequests internal redirects start off with the same filter list as the connection 2) AddInputFilter directive (blatant rip-off of Ryan's AddOutputFilter directive); as with AddOutputFilter, the network is implicitly to the right of the specified filter list; this may not be the most intuitive way to specify the filters; not sure yet
Now that we have ap_add_input_filter(), rename ap_add_filter() to ap_add_output_filter().
Connection oriented filters are now stored in the conn_rec instead of the request_rec. This means that a conn_rec must be supplied when calling ap_add_filter. The reason for this change is that we need to be able to add the core_filter (whether or SSL or not) before we try to read the request. This way, if a request fails, we can actually send the error page back to the client. With this change, we add the core filter to the conn_rec during the pre-connection phase. Submitted by: Ryan Bloom, Jeff Trawick, and Greg Ames
Move where the CORE_IN filter is added to the server. We used to do this in ap_new_connection, but that is bogus, because then other modules can't put their own filter in. Now, we do this in a new pre-connection hook function. Later, we will want to add some checking to make sure that this is really an HTTP request that we are adding the filter for.
Implement input filtering. This is definately not completely correct, but it is a good first step. It is possible to add filters when reading from the client with this change.
Remaining cleanup of ap_ -> apr_ and AP_ -> APR_ transformation... see src/lib/apr/apr_compat.h for most details. Also a few minor nits to get Win32 to build. PR: Obtained from: Submitted by: Reviewed by:
prefix libapr functions and types with apr_
Move all APR functions related to strings to their own directory, and create a new header for those functions. This is the first step to removing the apr/lib directory completely, and moving those files/functions to descriptive directories.
Fix some bad ap_log_error() invocations. Comment on a bad ap_log_rerror() invocation. Almost all of this is in code never compiled.
Remove const from ap_socket_t parameters on APR functions so that APR can modify the ap_socket_t as it sees fit. It may choose to modify the ap_socket_t on functions which only read from the ap_socket_t conceptually. Note: http_connection::ap_new_apr_connection() passes its ap_socket_t arg to one of the changed functions, so const was removed there also.
Removed the pointless ap_is_aborted macro.
Add notes field to conn_rec
Protect system header files with the appropriate macros.
Clean up a big chunk of ap_config.h. This basically stops ap_config.h from including any files. Because of this change, other files must include their own headers. I also cleaned up a couple of other bugs in some modules because I had to compile them all. I expect this to break multiple platforms, but this will be fixed over time. The massive configure cleanup is almost done. I will go through the files one more time after this commit.
PR: Obtained from: Submitted by: Reviewed by: Reverse out additional linkage argument from DECLARE_HOOK and IMPLEMENT_HOOK macros.
This patch corrects the issues from the AP_EXPORT and linkage
specification arguments to the ap_hooks.h declarations. As with
the APR_ and AP_ patches, API_VAR_EXPORT becomes API_EXPORT_VAR,
and MODULE_VAR_EXPORT becomes MODULE_EXPORT_VAR.
I will be happy to revert the inclusion of ap_config.h from
httpd.h if this bothers anyone. More individual modules need
to be patched if we do so.
The API_EXPORTs all moved into central storage in the ap_config.h
header. Without WIN32 or API_STATIC compile time declarations,
these macros remain no-ops.
This patch also moves the following data from http_main to http_config:
const char *ap_server_argv0;
const char *ap_server_root;
ap_array_header_t *ap_server_pre_read_config;
ap_array_header_t *ap_server_post_read_config;
ap_array_header_t *ap_server_config_defines;
And the following variables had already moved into ap_hooks.c:
ap_pool_t *g_pHookPool; (initialized now in http_config)
int g_bDebugHooks; (out of http_config)
const char *g_szCurrentHookName; (out of http_config)
The changes to http_main.c are in preparation for that module to
move out to a seperate .exe for win32. Other platforms will be
unaffected, outside of these changes.
Create new function, ap_lingering_close(), which will explicitly do a lingering close if USE_SO_LINGER is not defined. Move responsibility for closing connections out of http_connection.c and into the MPMs.
Exit connection processing normally on a graceful shutdown (which will allow a lingering close where applicable). Set is_graceful in the winnt MPM.
change ap_hook_pre_connection from VOID to RUN_ALL
add AP_ prefix to *HOOK* macros
Change ap_context_t to ap_pool_t. This compiles, runs, and serves pages on Linux, but probably breaks somewhere.
Get lingering_close() working again.
Update to Apache Software License version 1.1
Fix all the License issues. Including: s/Apache Group/Apache Software Foundation/ s/1999/2000/ s/Sascha's license/ASF license
Include ap_config.h before httpd.h, this ensures that AP_USE_HSREGEX is defined correctly in all C files.
Finish the commits for the change in the header files. Basically, this hides all of the Apache macros that modules don't need access to. This should have been committed with the modules, but I wasn't paying attention to the directory I was in when I ran the commit. Submitted by: Manoj Kasichainula and Ryan Bloom
Cleanup the ZZZ comments. Basically these used to mark places where APR is needed. It is much easier to do this conversion by hand than by searching for old comments, so they are going away now.
ap_bflush and ap_bclose now return ap_status_t error codes instead of returning -1 and setting errno.
Enhancements for APR network_io. Adds separate local/remote access methods for a socket's port, IP address and sockaddr_in. Updates for Apache code to use these, allowing the correct IP address of clients to be logged.
Add a connection status table to replace the old function of the scoreboard. It allows MPMs to implement their own mechanism for the status table and allows any module to add its own per-connection status entries.
Fix typos
Changed pools to contexts. Tested with prefork and pthread mpm's. I'll check this out tomorrow and make sure everything was checked in correctly.
Make ``configure --with-option=devel'' under GCC 2.95.1 happy by avoiding various warnings...
Add a connection ID to conn_rec. It uniquely identifies a connection at any instant in time. It's not very well tested yet.
merge the differences in apache-1.3 from tag apache-apr-merge-3 up to mpm-merge-1 onto the mpm tree prior to the merge, the mpm tree was tagged with apache-1_3-merge-1-pre and after the merge, the mpm tree will be tagged with apache-1_3-merge-1-post note: none of htdocs/manual is present in mpm at this point.
Take child_num and thread_num out of conn_rec. They aren't used anywhere anymore, and conn_rec is the wrong place for them.
Break out the hook implementations into three kinds, thus avoiding null macro arguments. Gates made me do it!
Another hook (I won't be upset if someone else wants to do some!).
Actually, we should always close the connection when it is finished.
And with one bound, he was free! This seemingly minor change allows modules to take over connection processing, thus making Apache multiprotocol. Woo!
Make run_all symbolic.
Sorry, but using C comments in place of C++ comments makes life for me and my compiler much easier.
More hooky stuff.
Strawman hooks implementation (beginning of).
Use ap_new_connection in pthread MPM. This required adding an argument to ap_new_connection for now: thread_num.
New API for I/O layering, and dependency updates.
ap_mpm_graceful_stop -> ap_graceful_stop_signalled
Compile on FreeBSD.
I'm sure this is wrong... but it's my start. i/o layering. Lots of stuff disabled/still to be implemented. This served up a few static requests.
Initial revision
This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.
| apache@apache.org | ViewVC Help |
| Powered by ViewVC 1.1.2 |