76 Commits

Author SHA1 Message Date
6bd9d17e08 *) core: adding a new hook and method to the API:
create_secondary_connection and ap_create_secondary_connection()
     to setup connections related to a "master" one, as used in
     the HTTP/2 protocol implementation.

  *) mod_http2: using the new API calls to get rid of knowledge
     about how the core handles conn_rec specifics.
     Improvements in pollset stream handling to use less sets.
     Using atomic read/writes instead of volatiles now.
     Keeping a reserve of "transit" pools and bucket_allocs for
     use on secondary connections to avoid repeated setup/teardowns.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899032 13f79535-47bb-0310-9956-ffa450edef68
2022-03-18 09:52:52 +00:00
6d9a8cd1f2 In case one of the pre_connection hooks causes the hook run to stop by an error
the pre_connection hook of the core module maybe did not run
(it is APR_HOOK_REALLY_LAST) and hence we missed to

- Put the socket in c->conn_config
- Setup core output and input filters
- Set socket options and timeouts

For calls of ap_run_pre_connection where this matters create a wrapper named
ap_pre_connection that ensures that this happens.

* include/ap_mmn.h: Bump minor version as we added new ap_pre_connection
  function.

* include/http_connection.h: Declare ap_pre_connection prototype.

* server/connection.c: Make use of ap_pre_connection in ap_process_connection.

* server/core.c: Implement ap_pre_connection.

* server/mpm/event/event.c: Make use of ap_pre_connection.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1893497 13f79535-47bb-0310-9956-ffa450edef68
2021-09-21 20:03:52 +00:00
2b7f51ade7 core: Add ap_create_connection() to create a server or client/proxy connection.
c->outgoing shouldn't be set by mod_ssl, ap_create_connection() allows that
and this commit also replaces all the calls to ap_run_create_connection() in
mod_proxy modules (not in the MPMs which create incoming connections only).

* include/http_connection.h, server/connection.c:
  Declare and implement ap_create_connection().

* modules/proxy/proxy_util.c, modules/proxy/mod_proxy_connect.c,
  modules/proxy/mod_proxy_ftp.c:
  Use ap_create_connection() instead of ap_run_create_connection(), and don't
  provide a connection_id a scoreboard handle for outgoing connection.

* server/log.c(do_errorlog_default):
  Use c->outgoing instead of c->sbh to determine if it's a "client" or "remote"
  connection.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1893184 13f79535-47bb-0310-9956-ffa450edef68
2021-09-09 16:55:24 +00:00
e70247afa2 new hook pre_close_connection
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1727071 13f79535-47bb-0310-9956-ffa450edef68
2016-01-27 14:51:53 +00:00
8e20c7682e Fix comment.
Remove @file and @brief from within the @defgroup to be consistenbt with doxygen comments from other files.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1611919 13f79535-47bb-0310-9956-ffa450edef68
2014-07-19 16:37:29 +00:00
ff0963e3f7 mpm_event[opt]: Send the SSL close notify alert when the KeepAliveTimeout
expires. PR54998.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1601185 13f79535-47bb-0310-9956-ffa450edef68
2014-06-07 22:57:08 +00:00
178d3027ef Fix URL in doxygen comment.
Previous link was broken.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1599799 13f79535-47bb-0310-9956-ffa450edef68
2014-06-03 21:11:31 +00:00
1951a037bf More cleanup: Expand tabs and some more indentation fixes
No functional change


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174929 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 18:08:42 +00:00
103f776c25 Cleanup effort in prep for GA push:
Trim trailing whitespace... no func change



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174748 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 13:38:09 +00:00
18fdb9d711 Some improvements for handling of many connections for MPM event:
- Process lingering close asynchronously instead of tying up worker threads
  (based on patch by Jeff Trawick).

- If the number of connections of a process is above

     threads_per_child  +  WORKER_OVERCOMMIT * (idle_workers - 1)

  (WORKER_OVERCOMMIT is fixed at 2, at the moment), or if all workers are busy,
  don't accept new connections in that process. Such a dynamic connection limit
  is necessary because we may have both async and non-async (ssl) connections.
  WORKER_OVERCOMMIT should be a config option.

- Don't count idle workers of not-accepting processes against MinSpareThreads,
  so that the parent will spawn new processes when necessary.

- If we receive a keep-alive request while all workers are busy, don't block
  but close the connection immediately so that the client will re-connect to a
  different process.

Related changes:

- Log what is going on at trace loglevels.
- Remove the bypass_push poll type flag, this code cannot be hit anymore
  (if it ever could?).
- Add some macro helpers for dealing with timeout queues.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1137358 13f79535-47bb-0310-9956-ffa450edef68
2011-06-19 12:23:42 +00:00
2aef21903c Cleanup... most don't need apr_hooks.h at all...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1101067 13f79535-47bb-0310-9956-ffa450edef68
2011-05-09 15:36:32 +00:00
5e415009f3 Remove CORE_PRIVATE.
This define serves no modern purpose, since every module in the wild, including 
our own define it, for no purpose.

If you have functions which you do not want in the 'public' API, put them
in a private header, that is not installed, just like mod_ssl does.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645412 13f79535-47bb-0310-9956-ffa450edef68
2008-04-07 08:44:14 +00:00
de659cbed0 update license header text
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@420983 13f79535-47bb-0310-9956-ffa450edef68
2006-07-11 20:33:53 +00:00
dd95d7c37c Update the copyright year in all .c, .h and .xml files
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@395228 13f79535-47bb-0310-9956-ffa450edef68
2006-04-19 12:11:27 +00:00
8c1e315d3f Doxygen fixup / cleanup
submited by: Neale Ranns neale ranns.org
reviewed by: Ian Holsman



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@263931 13f79535-47bb-0310-9956-ffa450edef68
2005-08-28 23:03:59 +00:00
905cdf9f0b Update copyright year to 2005 and standardize on current copyright owner line.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151408 13f79535-47bb-0310-9956-ffa450edef68
2005-02-04 20:28:49 +00:00
48c38a4533 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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102793 13f79535-47bb-0310-9956-ffa450edef68
2004-02-28 00:45:26 +00:00
eeb57c17ad fix name of The Apache Software Foundation
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102619 13f79535-47bb-0310-9956-ffa450edef68
2004-02-09 20:40:53 +00:00
129635b965 fix copyright dates according to the first check in
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102548 13f79535-47bb-0310-9956-ffa450edef68
2004-02-07 19:27:57 +00:00
4f02cb1e18 apply Apache License, Version 2.0
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102525 13f79535-47bb-0310-9956-ffa450edef68
2004-02-06 22:58:42 +00:00
fb07607180 update license to 2004.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102135 13f79535-47bb-0310-9956-ffa450edef68
2004-01-01 13:26:26 +00:00
742af25096 finished that boring job:
update license to 2003.

Happy New Year! ;-))


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98573 13f79535-47bb-0310-9956-ffa450edef68
2003-02-03 17:53:28 +00:00
3e2ce19baf 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94304 13f79535-47bb-0310-9956-ffa450edef68
2002-03-29 08:17:26 +00:00
845cbfd508 Update our copyright for this year.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93918 13f79535-47bb-0310-9956-ffa450edef68
2002-03-13 20:48:07 +00:00
862f407872 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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93259 13f79535-47bb-0310-9956-ffa450edef68
2002-02-05 22:18:49 +00:00
bd3d360392 Reintroduce the create_connection hook. This hook is required to enable
modules to completely take over all network i/o from the core.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93171 13f79535-47bb-0310-9956-ffa450edef68
2002-02-01 22:16:31 +00:00
4168820850 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93087 13f79535-47bb-0310-9956-ffa450edef68
2002-01-29 19:02:04 +00:00
327e4989d5 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93050 13f79535-47bb-0310-9956-ffa450edef68
2002-01-27 12:52:08 +00:00
187e9ae3b9 Change core code to allow an MPM to set hard thread/server
limits at startup.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92512 13f79535-47bb-0310-9956-ffa450edef68
2001-12-18 13:48:54 +00:00
a4f00625aa 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91968 13f79535-47bb-0310-9956-ffa450edef68
2001-11-15 20:49:54 +00:00
695081280d Add the server_rec argument back to the create_connection hook.
Submitted by:	Greg Stein


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91913 13f79535-47bb-0310-9956-ffa450edef68
2001-11-13 20:29:54 +00:00
22b467666a Remove ap_new_connection from the header. I missed this when I removed
the function.
Submitted by:   Brad Nicholes <BNICHOLES@novell.com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91911 13f79535-47bb-0310-9956-ffa450edef68
2001-11-13 20:10:11 +00:00
3d76585bad Back out my last patch. The logic to add sockets to pollsets is back in
the MPM


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91906 13f79535-47bb-0310-9956-ffa450edef68
2001-11-13 17:44:07 +00:00
a47ed5762d 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91899 13f79535-47bb-0310-9956-ffa450edef68
2001-11-13 07:15:36 +00:00
61ebbf74e3 Add docs for the newest hook.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91892 13f79535-47bb-0310-9956-ffa450edef68
2001-11-13 04:01:28 +00:00
44baa0367f 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91890 13f79535-47bb-0310-9956-ffa450edef68
2001-11-13 02:09:07 +00:00
0c05b625ac 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91887 13f79535-47bb-0310-9956-ffa450edef68
2001-11-12 23:49:08 +00:00
383606d518 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91839 13f79535-47bb-0310-9956-ffa450edef68
2001-11-10 21:07:13 +00:00
13cf9521f5 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91832 13f79535-47bb-0310-9956-ffa450edef68
2001-11-10 18:26:30 +00:00
c86f120560 Doc formatting fixes
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89749 13f79535-47bb-0310-9956-ffa450edef68
2001-07-27 21:01:16 +00:00
86154b12b2 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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89078 13f79535-47bb-0310-9956-ffa450edef68
2001-05-11 04:35:41 +00:00
3eeeb76fb4 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88449 13f79535-47bb-0310-9956-ffa450edef68
2001-03-04 06:27:27 +00:00
381f88d56a Update copyright to 2001
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88184 13f79535-47bb-0310-9956-ffa450edef68
2001-02-16 04:26:53 +00:00
bd424f80f3 ap_new_connection() returns NULL if an error occurred (prefork MPM
and ap_new_connection() were changed last week)

I have skipped putting the change into WinNT MPM and mod_proxy.  I
left a note in the mod_proxy code; for the NT MPM I think I can talk
somebody into doing the right thing for me.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87982 13f79535-47bb-0310-9956-ffa450edef68
2001-02-05 15:04:32 +00:00
bcb1a9309e fix minor prototype inconsistencies noticed with C::Scan
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87970 13f79535-47bb-0310-9956-ffa450edef68
2001-02-04 03:00:15 +00:00
e62172bbdd The fast fix to get FirstBill back out of the gate. It brings up an
issue I'll address to the list.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87748 13f79535-47bb-0310-9956-ffa450edef68
2001-01-19 22:32:15 +00:00
850f8cc33a By popular review
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87739 13f79535-47bb-0310-9956-ffa450edef68
2001-01-19 18:38:34 +00:00
59bbd68bec 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87731 13f79535-47bb-0310-9956-ffa450edef68
2001-01-19 07:04:36 +00:00
4c8baf6170 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87181 13f79535-47bb-0310-9956-ffa450edef68
2000-12-04 19:24:10 +00:00
ffe0634565 Fix some incorrect docs
Submitted by:	Jon Travis <jtravis@covalent.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87098 13f79535-47bb-0310-9956-ffa450edef68
2000-11-28 03:01:10 +00:00