1
0
mirror of https://github.com/apache/httpd.git synced 2026-01-26 19:01:35 +03:00
Commit Graph

318 Commits

Author SHA1 Message Date
Cliff Woolley
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
William A. Rowe Jr
4dd3d43b9c Somewhere about server/main.c rev 1.54, we lost the stop|shutdown|uninstall
when the .conf file is missing or horribly corrupt.  Move those actions
  into the rewrite args phase so we don't trip over a missing .conf file,
  we couldn't care less if we are stopping/uninstalling Apache.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94189 13f79535-47bb-0310-9956-ffa450edef68
2002-03-26 20:13:37 +00:00
William A. Rowe Jr
71a2c46459 -i and -u were deprecated some time ago, they still work in 1.3, but
shouldn't be expected to work in 2.0.  Replacement command line options
  are -k install|uninstall


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94161 13f79535-47bb-0310-9956-ffa450edef68
2002-03-25 19:05:59 +00:00
Bill Stoddard
d317a65c5b Tag some pools.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94139 13f79535-47bb-0310-9956-ffa450edef68
2002-03-22 20:23:00 +00:00
Ryan Bloom
ba4014adba Port the -k config option to Apache 2.0. This allows users to reconfigure
their service after it has been installed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94113 13f79535-47bb-0310-9956-ffa450edef68
2002-03-22 01:28:01 +00:00
William A. Rowe Jr
cb7bb7bb8c No sense in opening this event when it's already opened in the parent.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94050 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 07:49:02 +00:00
William A. Rowe Jr
0a28d5809d More process lifetime changes, and simplify some ambigious cruft.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94046 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 06:55:39 +00:00
William A. Rowe Jr
cda6c47f99 Fix a few listener-related lifetime issues [they are created in the
open logs phase, only once.]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94041 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 06:14:19 +00:00
William A. Rowe Jr
cec6d4b870 The pre_mpm hook creates server-lifetime objects (or at least, for the
generations across graceful restarts.)  They should use the process pool.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94039 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 05:58:21 +00:00
William A. Rowe Jr
1ab2f45a70 When restarting [always graceful on Win32], we don't repeat pre_mpm
(Unix doesn't, we shouldn't either.)  [Ryan Bloom]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94032 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 04:29:55 +00:00
William A. Rowe Jr
abaf919813 Axe unused variable
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93961 13f79535-47bb-0310-9956-ffa450edef68
2002-03-15 20:34:30 +00:00
William A. Rowe Jr
2a0e4fd83c Some lingering debug cruft that isn't needed
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93930 13f79535-47bb-0310-9956-ffa450edef68
2002-03-14 04:43:11 +00:00
William A. Rowe Jr
c46662465d Use fprintf to stderr over printf. Better yet - replace with the
logger, but my brain just isn't quite there tonight.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93929 13f79535-47bb-0310-9956-ffa450edef68
2002-03-14 04:37:14 +00:00
William A. Rowe Jr
f2e2cdcdb8 My [sixth?] major revamp of service.c. Traded an event for a mutex
to the service_init completion, expanded timeouts, moved SERVICE_STOPPED
  message posting to the main thread since sometimes, in odd cirumstances,
  our SCM thread wasn't resumed prior to termination, and ripped the code
  for the stderr logs to use nt_eventlog.c instead.  And generally tried
  to make the code just a little bit more grokable [as if such a thing
  is really possible.]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93928 13f79535-47bb-0310-9956-ffa450edef68
2002-03-14 04:34:03 +00:00
William A. Rowe Jr
3dab10782e Cleanup the eventlogger code, and split it into its own source.
[got the copyright correct, no less.]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93927 13f79535-47bb-0310-9956-ffa450edef68
2002-03-14 04:19:00 +00:00
William A. Rowe Jr
6d0a9307b3 Now that we test ownership of the listeners in listen.c, -k "start"
can no longer hang on to the listeners after it checks that they are
  free.  Also, we cannot be checking listeners if we are using -k "config"
  to alter the service config, since the service might be running as we
  try this, and we cannot check the listeners in -k "restart", since we
  are pretty certain they are owned by the running service we are about
  to try restarting..


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93926 13f79535-47bb-0310-9956-ffa450edef68
2002-03-14 04:12:12 +00:00
William A. Rowe Jr
fa3ba046f1 The be-certain-we-own-the-socket patch to listen.c fails if we hang
on to the originals after duplicating sockets.  If you dup, you aught
  to be closing the source.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93925 13f79535-47bb-0310-9956-ffa450edef68
2002-03-14 04:08:51 +00:00
Roy T. Fielding
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
William A. Rowe Jr
c3cd7cb117 Some info messages mean something to only three people in this world,
let's start dropping some to debug until we have the essentials of
  parent -> create child -> child running -> parent shutting down
    -> child exiting -> child quit -> parent exited  at APLOG_INFO level.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93516 13f79535-47bb-0310-9956-ffa450edef68
2002-02-20 17:32:36 +00:00
William A. Rowe Jr
974d023cca Seems Terminal Server flavors were failing global_mutex_init, but it was
somewhat hard to tell, seeing as we never log any status until we can't
  obtain the mutex.  Lots more rv checking is required in here, would
  appreciate if new/touched code grew the appropriate tests.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93515 13f79535-47bb-0310-9956-ffa450edef68
2002-02-20 17:18:05 +00:00
Bill Stoddard
3457bfe59d Win32: Migrate mpm_winnt away from the deprecated apr_lock API
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93504 13f79535-47bb-0310-9956-ffa450edef68
2002-02-19 23:01:23 +00:00
William A. Rowe Jr
1e4af39ee0 The final commit to achieve a quality release. We cannot use CreateThread
on Win32 when using the clib; msvcrt has its own initialization and
  destruction, so it needs its own turn.  _createthreadex is the same but
  different - it's implemented by msvcrt and causes all the appropriate
  setup and teardown to occur.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93385 13f79535-47bb-0310-9956-ffa450edef68
2002-02-13 03:33:34 +00:00
William A. Rowe Jr
40eb3b9322 After hours of debugging, the answer was -trivial-, but extremely
obscure and difficult to trace.  This should do away with the handle
  corruption we experienced.  If anyone cares to walk the crt (source
  is installed in vc\src\crt if you install it w/ Visual C++/Studio)
  it's worth understanding why this occured.

  This patch

    1. creates the pipe non-inherited, and dups the write end
       for inheritence with limited permissions.
    2. sets the STD_ERROR_HANDLE _after_ we fixup the FILE *stderr and fd 2.
    3. Splits the signal_monitor event in two, service_init/service_term
       for clarity and correctness.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93374 13f79535-47bb-0310-9956-ffa450edef68
2002-02-12 17:32:06 +00:00
William A. Rowe Jr
78470dfa6b Perform a serious scrubbing of the child process, before we report that
we failed to create the child.  Cleans up CloseHandle() destruction to
  match all created handles - and postpone populating the *child_exit_event
  until we succeed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93369 13f79535-47bb-0310-9956-ffa450edef68
2002-02-12 00:14:47 +00:00
William A. Rowe Jr
c54cc841b5 Move the sleep until after we have duplicated the simple handles. We must
still pause and reflect on the Child's startup before WSADuplicateHandle()


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93367 13f79535-47bb-0310-9956-ffa450edef68
2002-02-11 23:34:10 +00:00
William A. Rowe Jr
cc21a8347c Never close the handle, if it is the StdError psuedohandle.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93363 13f79535-47bb-0310-9956-ffa450edef68
2002-02-11 20:32:04 +00:00
Bill Stoddard
8cbea60c02 Win32: Handles returned by GetStdHandle are psuedo handles and should never be
passed to a CloseHandle call.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93361 13f79535-47bb-0310-9956-ffa450edef68
2002-02-11 15:46:44 +00:00
Bill Stoddard
50c6644188 Make apache -k shutdown an alias for apache -k stop. "shutdown" maintained
for backward compatability.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93360 13f79535-47bb-0310-9956-ffa450edef68
2002-02-11 15:40:07 +00:00
Bill Stoddard
05a340b495 Get apache -k restart -n apache2 working reliabily again.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93359 13f79535-47bb-0310-9956-ffa450edef68
2002-02-11 15:24:46 +00:00
William A. Rowe Jr
34202944a9 Some considerable fixes in sending log messages out to the event log.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93343 13f79535-47bb-0310-9956-ffa450edef68
2002-02-08 19:37:47 +00:00
William A. Rowe Jr
69c9e8d02f Drawing attention to the timing problem; push the wait up so we do about
nothing until WinNT initializes the app.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93342 13f79535-47bb-0310-9956-ffa450edef68
2002-02-08 19:37:02 +00:00
William A. Rowe Jr
eb1fd4e4b1 Eliminate tons o cruft - we are in another thread - and these can all
be longlived malloced regions, or sit upon the stack.  No need to mess
  with pool conflicts.

  The remaining pool accesses are still a problem to resolve.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93327 13f79535-47bb-0310-9956-ffa450edef68
2002-02-07 06:28:45 +00:00
William A. Rowe Jr
73f8d723dd Upon advice of the FirstBill, I began looking for exceptions that occur
only in the service-mode.  SetServiceDescription was borked, now fixed.
  Since we don't use the posix/libc style stderr, I've also pitched that
  code, which was causing an exception.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93326 13f79535-47bb-0310-9956-ffa450edef68
2002-02-07 00:24:12 +00:00
William A. Rowe Jr
c1246190bd If we only need to toggle the event, don't ask for the whole ball 'o wax.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93313 13f79535-47bb-0310-9956-ffa450edef68
2002-02-06 21:09:26 +00:00
William A. Rowe Jr
9b71731f86 Occifer Will from the Redundacy Dept of Redundancy reporting for duty...
Cleaning up a few more variables and fix a logged err status.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93308 13f79535-47bb-0310-9956-ffa450edef68
2002-02-06 19:23:43 +00:00
William A. Rowe Jr
d38559393e Move around a bit of code so I can follow it better. -> EOF should always
take us to the module struct, and working backwards, the register hooks
  and then top-level init stuff.  At least that's how any other Apache
  module is authored.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93306 13f79535-47bb-0310-9956-ffa450edef68
2002-02-06 19:06:39 +00:00
William A. Rowe Jr
3e65d196f1 Give the child GENERIC_WRITE only to the stderr log channel,
GENERIC_READ|GENERIC_WRITE to the scoreboard mapping,
  EVENT_MODIFY_STATE|SYNCHRONIZE to it's exit event,
  and fix a _major_ bug in the NullACL code that set the length
  by the size of the pointer-to-acl, rather than the size of an acl.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93300 13f79535-47bb-0310-9956-ffa450edef68
2002-02-06 18:23:31 +00:00
William A. Rowe Jr
5cb0ddf326 A cleanup from the redundancy dept. of redundancy
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93281 13f79535-47bb-0310-9956-ffa450edef68
2002-02-06 08:14:11 +00:00
William A. Rowe Jr
62d05aef8b Leaky as a sieve.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93280 13f79535-47bb-0310-9956-ffa450edef68
2002-02-06 08:11:23 +00:00
William A. Rowe Jr
d1cc4eb611 Didn't mean to leave that in there. MPM works, how well I haven't yet
determined.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93279 13f79535-47bb-0310-9956-ffa450edef68
2002-02-06 07:31:31 +00:00
William A. Rowe Jr
3bbf558bdf Clean up more bogosity and leaky pipes [and fix a recent bug].
1. The only good assert is a deleted assert.

  2. The child exit event is a very private item, can't pollute into
     other processes we create, shouldn't be named, and should never
     be accessable to anyone but the parent.

  3. We now pass 'handles', not just a single scoreboard.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93278 13f79535-47bb-0310-9956-ffa450edef68
2002-02-06 07:30:22 +00:00
William A. Rowe Jr
4eaea0dfe7 1. gotta look at the child return code (think kindergarden, you've got
to keep an eye on those kids.)

  2. gotta return a respectable exit code.

  3. gotta have a few sensible messages.

  4. gotta know where we went.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93276 13f79535-47bb-0310-9956-ffa450edef68
2002-02-06 05:53:10 +00:00
William A. Rowe Jr
8eb35fc415 Start simplifying and grouping code. Building on the work that rbb
had begun; we need to start organizing this so it can be groked by
  more than one person at a time [or simply by more than one person.]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93275 13f79535-47bb-0310-9956-ffa450edef68
2002-02-06 04:27:22 +00:00
William A. Rowe Jr
3648a954cb These crit errors make -0- sense. Interesting info entry, however.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93257 13f79535-47bb-0310-9956-ffa450edef68
2002-02-05 22:00:48 +00:00
Ryan Bloom
1c8af1bea1 Port the listener bind patch from the Unix MPMs to Windows. This allows
ANy windows bind message to be printed to the console if the server was
started from the command line.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93244 13f79535-47bb-0310-9956-ffa450edef68
2002-02-05 01:13:37 +00:00
William A. Rowe Jr
c0e94b16de Fixed for the recent apr-ized logfile changes. The Win32 service never
has a STDERR channel in the first place, so the first ap_open_stderr_log()
  fails.  We need to open it after we've initialized the service control
  manager and created the stderr pipe thread that logs stderr output over
  in our Application Event Log.

  The failure message still looks pretty danged stupid on WinXP however;
  "The Apache2 service on Local Computer started and then stopped."
  [ok, that part is straightforward.]  "Some services stop automatically
  if they have no work to do, for example, the Performance Logs and
  Alerts service."  [that's the bogus bit.]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93241 13f79535-47bb-0310-9956-ffa450edef68
2002-02-04 23:37:37 +00:00
Bill Stoddard
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
Ryan Bloom
5cd5470300 Change the Windows MPM to only use the pre_mpm phase in the parent process.
The child processes use the child_init phase to reattach to the shared
memory.  This makes Windows work like Unix, which should make it easier
for module authors to write portable modules.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93119 13f79535-47bb-0310-9956-ffa450edef68
2002-01-30 22:35:57 +00:00
Bill Stoddard
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
Aaron Bannert
d5fdaf9cfd The pre_config hook now takes a return value. This allows modules to
cause the server to bail out under error conditions.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93063 13f79535-47bb-0310-9956-ffa450edef68
2002-01-28 23:49:40 +00:00