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

2167 Commits

Author SHA1 Message Date
Brian Pane
879f6fef32 Updated ap_getword_white() to use the same coding style
(and optimizations) as ap_getword()


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94854 13f79535-47bb-0310-9956-ffa450edef68
2002-04-29 07:20:46 +00:00
Brian Pane
69371c8cb3 Removed some code from the mutex-protected block in ap_queue_pop().
If the worker thread synchronization is working properly, it's not
necessary to set these fields to NULL after removing an element from
the queue, and it's IMO more important to have a shorter code path
leading up to the mutex_unlock.  I left in support for NULLing the
fields when debugging, though.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94850 13f79535-47bb-0310-9956-ffa450edef68
2002-04-29 01:57:39 +00:00
Aaron Bannert
cb83b744d3 Rename the worker_stack_interrupt_all() function as worker_stack_terminate().
Also, broadcast a signal after we set the terminate flag on the worker stack.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94846 13f79535-47bb-0310-9956-ffa450edef68
2002-04-28 23:28:52 +00:00
Brian Pane
d3d545e861 Removed the "not_full" condition variable and associated conditional
logic from the file descriptor queue, now that we can rely on the
idle worker reference count to keep the listener from trying to
push connections into a full queue
Reviewed by:	Aaron Bannert (concept)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94845 13f79535-47bb-0310-9956-ffa450edef68
2002-04-28 23:12:35 +00:00
Aaron Bannert
c332ff37bc Remove unused variable.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94844 13f79535-47bb-0310-9956-ffa450edef68
2002-04-28 23:10:26 +00:00
Aaron Bannert
5e647365f8 Some more threadpool MPM changes:
- Add a "state" variable to the worker_wakeup_info struct. This is
  used to make sure that we act on the correct signal, and to know when
  to shut down a worker thread.
- Fix the call when the worker thread waits for a connection to use
  the new state variable and use mutexes around the cond_wait() call.
- Change the interrupt_all() call to set the WORKER_TERMINATED state.
- Add two AP_DEBUG_ASSERT() to make sure that we aren't waking up
  a worker thread before it is idle.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94843 13f79535-47bb-0310-9956-ffa450edef68
2002-04-28 23:05:15 +00:00
Aaron Bannert
464b62610a Clarify an incorrect statement about why we're purposfully putting
the signal inside of a mutex.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94842 13f79535-47bb-0310-9956-ffa450edef68
2002-04-28 22:32:17 +00:00
Aaron Bannert
31a81c8637 Some threadpool fixes:
- We don't need the listener_blocked flag, just check if the element
  we're adding makes the stack non-empty.
- When we are terminated, return APR_EOF; catch this event in the
  worker thread and the listener thread.
- When shutting down, always signal a potential listener thread.
- Wait to signal the listener thread until after we add the worker
  element to the stack.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94841 13f79535-47bb-0310-9956-ffa450edef68
2002-04-28 22:25:16 +00:00
Aaron Bannert
03966a632c Detect APR_EINTR from ap_queue_pop() and avoid calling
ap_queue_info_set_idle() more than once at a time per worker thread.
This fixes an assert coredump.

Submitted by:	Aaron Bannert
Reviewed by:	Brian Pane


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94840 13f79535-47bb-0310-9956-ffa450edef68
2002-04-28 22:13:32 +00:00
Aaron Bannert
f0b69299d6 When we signal a condition variable, we need to own the lock that
is associated with that condition variable. This isn't necessary
for Solaris, but for Posix it is.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94839 13f79535-47bb-0310-9956-ffa450edef68
2002-04-28 21:35:12 +00:00
Bill Stoddard
19c2013395 Fix a bug in the mod_status display caused by some uninitialized fields.
Prep for taking mpm_winnt to multi-process...


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94838 13f79535-47bb-0310-9956-ffa450edef68
2002-04-28 21:09:36 +00:00
Justin Erenkrantz
f8ead96f43 Simplify this little chunk of code since r is set to f->r earlier.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94831 13f79535-47bb-0310-9956-ffa450edef68
2002-04-28 06:24:53 +00:00
Brian Pane
6625520bac Moved the recycled pool list from the queue to the queue_info structure.
The advantage of doing this is that it enables us to guarantee that the
number of ptrans pools in existence at once is no greater than the
number of worker threads, and that we'll never have to delete ptrans
pools.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94830 13f79535-47bb-0310-9956-ffa450edef68
2002-04-28 05:28:18 +00:00
Brian Pane
91aefd5c8f Added a missing pool deletion case and simplified the conditionals
for the error-case return (thanks to Justin for suggesting the
latter)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94829 13f79535-47bb-0310-9956-ffa450edef68
2002-04-28 04:48:43 +00:00
Brian Pane
669d2ac35c Move a potentially expensive pool cleanup operation outside
the mutex-protected critical path of ap_queue_pop()


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94828 13f79535-47bb-0310-9956-ffa450edef68
2002-04-28 03:32:10 +00:00
Aaron Bannert
c87eec9800 Preserve the original error, or if the unlock fails then use that
error instead.

Obtained from:  Justin Erenkrantz
Submitted by:	Aaron Bannert


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94827 13f79535-47bb-0310-9956-ffa450edef68
2002-04-28 03:20:06 +00:00
Brian Pane
a30639628a Removed creation of unused struct
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94826 13f79535-47bb-0310-9956-ffa450edef68
2002-04-28 01:58:26 +00:00
Aaron Bannert
23fa964736 Add a "queue_info" structure to the worker MPM. This is used to prevent
the listener thread from accept()ing more connections than there are
available workers. This prevents long-running requests from starving
connections that have been accepted but not yet processed.

The queue_info is a simple counter, mutex, and condition variable. Only
the listener thread blocks on the condition, and only when there are no
idle workers. In the fast path there is a mutex lock, integer decrement,
and and unlock (among a few conditionals). The worker threads each notify
the queue_info when they are about to block on the normal worker_queue
waiting for some connection to process, which wakes up any sleeping
listener thread to go perform another accept() in parallel.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94824 13f79535-47bb-0310-9956-ffa450edef68
2002-04-28 01:45:00 +00:00
Brian Pane
69c2dba0b4 Fixed the creation of the worker threads' data structures
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94823 13f79535-47bb-0310-9956-ffa450edef68
2002-04-28 00:34:49 +00:00
Bill Stoddard
384a8a1e8a my_generation is in the shared scoreboard now.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94822 13f79535-47bb-0310-9956-ffa450edef68
2002-04-27 21:01:20 +00:00
Bradley Nicholes
ca3c6503d6 Added a check to make sure that h_aliases is not NULL before we try to
dereference it in the for(...) loop.  Attempting to dereference a NULL pointer
was causing a fault if there were no aliases found.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94819 13f79535-47bb-0310-9956-ffa450edef68
2002-04-26 21:55:41 +00:00
Aaron Bannert
77adcc0737 Convert the worker MPM's fdqueue from a LIFO back into a FIFO. Since
elements in the queue represent accept()ed connections, we want them
to be processed in the order that they were received.  (I erroneously
converted it to a LIFO quite awhile ago in the hopes that it would
improve cache efficiency.)

Remember to perform a make clean in the worker directory after this patch,
since this patch changes the size of the fd_queue_t object (which is
allocated in worker.c).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94813 13f79535-47bb-0310-9956-ffa450edef68
2002-04-26 17:13:51 +00:00
Brian Pane
c32f6f16d2 Switch back from atomic_cas to mutexes, based on all the current
portability challenges with atomics


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94810 13f79535-47bb-0310-9956-ffa450edef68
2002-04-26 07:14:26 +00:00
Greg Ames
e5234ec416 remove a goto
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94807 13f79535-47bb-0310-9956-ffa450edef68
2002-04-25 20:51:49 +00:00
Greg Ames
6b40ae2b48 default_handler: short circuit the method checks. Move the code to deal
with unusual methods to the end of function to reduce i-cache clutter.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94781 13f79535-47bb-0310-9956-ffa450edef68
2002-04-24 14:31:28 +00:00
William A. Rowe Jr
e9f0ec41ac A bug affecting any platform that had pre-lstat'ed the file or directory
in question.  We neglected to clear the FINFO_LINK bit that told us this
  was lstat()ed, but also causes stat() to follow an lstat() approach.
  This is part 2 of 2 to correct the NTFS Junction (symlink) bug.

  Bugz report 8014, identified by Sam Morris <sam@netcity.co.uk>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94778 13f79535-47bb-0310-9956-ffa450edef68
2002-04-24 04:20:10 +00:00
William A. Rowe Jr
0b0f73b6c8 Formatting irk grinding at me while stepping code
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94777 13f79535-47bb-0310-9956-ffa450edef68
2002-04-24 03:52:59 +00:00
Ryan Bloom
bf8b6f0a80 Fix perchild MPM so that it can be configured with the move to the
experimental directory.  Fix perchild MPM so that it uses ap_gname2id
for groups instead of ap_uname2id.

Submitted by: Scott Lamb <slamb@slamb.org>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94760 13f79535-47bb-0310-9956-ffa450edef68
2002-04-22 18:57:12 +00:00
William A. Rowe Jr
ab67ee4456 Fix this optimization. We will skip along so long as we aren't at the
right number of components, -or- we mismatch on the current component.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94757 13f79535-47bb-0310-9956-ffa450edef68
2002-04-22 17:33:28 +00:00
William A. Rowe Jr
0468e9b273 Small optimization, if we are behind (at the 5th segment, for example),
catch up the segment-count-sorted directory list without string compares.
  Mostly affects win32 which jumps from seg 0 (root) to 4 for UNC path names.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94755 13f79535-47bb-0310-9956-ffa450edef68
2002-04-22 16:43:46 +00:00
Cliff Woolley
768d65eeac AcceptPathInfo was totally backwards... it would reject when set to on and
by default and accept when set to off for the default handler, and would
reject only if set to accept for mod_cgi(d) and mod_isapi.

PR: 8234


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94751 13f79535-47bb-0310-9956-ffa450edef68
2002-04-22 08:08:38 +00:00
Bill Stoddard
f0cee8f8fb Added the APLOG_TOCLIENT flag to ap_log_rerror() to
explicitly tell the server that warning messages should be sent
to the client in addition to being recorded in the error log.
Prior to this change, ap_log_rerror() always sent warning
messages to the client. In one case, a faulty CGI script caused
the server to send a warning message to the client that contained
the full path to the CGI script. This could be considered a
minor security exposure.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94744 13f79535-47bb-0310-9956-ffa450edef68
2002-04-22 03:25:40 +00:00
Cliff Woolley
cb27325d66 Ignore stuff
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94741 13f79535-47bb-0310-9956-ffa450edef68
2002-04-21 21:09:16 +00:00
Brian Pane
292fbad5b2 Use the day and month names exported from APR, rather than duplicating them
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94736 13f79535-47bb-0310-9956-ffa450edef68
2002-04-21 08:41:01 +00:00
Brian Pane
166b62f9c5 Added ap_recent_rfc822_date(), which uses the recent timestamp cache
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94735 13f79535-47bb-0310-9956-ffa450edef68
2002-04-21 07:55:50 +00:00
Brian Pane
279b274eb4 Workaround to get leader/follower compiling on recent Linuxes:
apr_atomic.h includes some <asm/*.h> header files that clash
with stdlib.h, so I've moved apr_atomic.h so that it's included
after all the other header files.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94734 13f79535-47bb-0310-9956-ffa450edef68
2002-04-20 20:41:33 +00:00
Cliff Woolley
649137f767 Propogate the change to insert "bucket_" into the names of the
static functions that operate on various bucket types to make
backtraces more sensible-looking.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94733 13f79535-47bb-0310-9956-ffa450edef68
2002-04-20 05:02:30 +00:00
William A. Rowe Jr
eea953f32a SOCKETs are HANDLEs, but they type mismatch. This fix has now been
verified by the vast majority of folks complaining about the "Not a
  handle" failures in WSADuplicateHandle, later in the code flow.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94712 13f79535-47bb-0310-9956-ffa450edef68
2002-04-19 17:51:31 +00:00
Brian Pane
1c3a94b86c Some code transformations to improve the generated assembly
code within the critical region inside the spin locks.  (Shortening
this code path reduces the probability that we'll have to spin.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94706 13f79535-47bb-0310-9956-ffa450edef68
2002-04-19 08:02:00 +00:00
Brian Pane
49098fff91 Replaced the mutex around the idle worker stack with
atomic compare-and-swap loops


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94705 13f79535-47bb-0310-9956-ffa450edef68
2002-04-19 06:33:08 +00:00
Jeff Trawick
767b98fcf5 back out ill-conceived attempt to fix a segfault during
graceless termination


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94700 13f79535-47bb-0310-9956-ffa450edef68
2002-04-18 17:46:20 +00:00
Justin Erenkrantz
7f594c679f Fix 'control reaches end of non-void function' warning
Submitted by:	Ben Collins-Sussman <sussman@collab.net>
Tweaked by:	    Justin Erenkrantz


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94695 13f79535-47bb-0310-9956-ffa450edef68
2002-04-18 08:27:28 +00:00
Justin Erenkrantz
a999901067 Perchild has been deemed experimental and has been moved to
server/mpm/experimental/perchild.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94693 13f79535-47bb-0310-9956-ffa450edef68
2002-04-18 08:16:56 +00:00
Justin Erenkrantz
b9ee6fd619 Perchild has been deemed experimental and has been moved to
server/mpm/experimental/perchild.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94692 13f79535-47bb-0310-9956-ffa450edef68
2002-04-18 08:04:57 +00:00
William A. Rowe Jr
c37e151a5f Experimental patch that may mitigate (but not eliminate) the errors in
[crit] (32538)An operation was attempted on something that is not a socket.
       : Parent: WSADuplicateSocket failed for socket ...
  if the particular stacks' bug is that it won't associate a handle as a
  socket if that handle was duped with DuplicateHandle().  Other bugs with
  unimplemented WSADuplicateSocket are not addressed by this patch.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94682 13f79535-47bb-0310-9956-ffa450edef68
2002-04-17 16:39:12 +00:00
William A. Rowe Jr
a43f5c4eb3 Introduced -E startup_logfile_name option to httpd to allow admins
to begin logging errors immediately.  This provides Win32 users
     an alternative to sending startup errors to the event viewer, and
     allows other daemon tool authors an alternative to logging to stderr.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94681 13f79535-47bb-0310-9956-ffa450edef68
2002-04-17 16:36:28 +00:00
Jeff Trawick
3f449a651e use an independent pool for threads so that when we abandon them
during graceless termination the cleanups on pchild won't mess with
stuff they are still referencing


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94679 13f79535-47bb-0310-9956-ffa450edef68
2002-04-17 15:45:27 +00:00
Brian Havard
9bdcd90181 When an exception in a worker thread initiates a child shutdown, get things
moving sooner by sending a SIGHUP to the accept thread, breaking it out
of its accept/poll.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94678 13f79535-47bb-0310-9956-ffa450edef68
2002-04-17 14:55:20 +00:00
Justin Erenkrantz
7f9ccb5f41 Add warning message when selecting an experimental MPM.
While this message will scroll by without their reading it, we can
reasonably say that we warned them if they report errors.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94674 13f79535-47bb-0310-9956-ffa450edef68
2002-04-16 23:44:56 +00:00
Brian Pane
55ed69bf5e Added support for the threadpool MPM
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94673 13f79535-47bb-0310-9956-ffa450edef68
2002-04-16 23:39:09 +00:00