1
0
mirror of https://github.com/apache/httpd.git synced 2026-10-23 22:49:01 +03:00
Commit Graph

2940 Commits

Author SHA1 Message Date
Jeff Trawick
743a621e8d Replace ap_get_server_version with ap_get_server_banner() and
ap_get_server_description().

High-level summary:

The full server version information is now included in the error log at
startup as well as server status reports, irrespective of the setting
of the ServerTokens directive.

Third-party modules must now use ap_get_server_banner() or 
ap_get_server_description() in place of ap_get_server_version().



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@440337 13f79535-47bb-0310-9956-ffa450edef68
2006-09-05 13:08:15 +00:00
André Malo
cab0f8754c fix eol-style
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@432686 13f79535-47bb-0310-9956-ffa450edef68
2006-08-18 19:16:54 +00:00
Chris Darroch
e69f467709 Introduce a check_config phase between pre_config and open_logs,
to allow modules to review interdependent configuration directive
values and adjust them while messages can still be logged to the
console.

The open_logs phase is already used somewhat for this purpose by
certain MPMs (winnt, prefork, worker, and event) but only by forcing
their functions ahead of the core ap_open_logs() function, and
since this phase runs after the ap_signal_server function during startup,
it can not be used to generate messages on the console when restarting.

Add the check_config phase to mod_info and mod_example.

Handle relevant MPM directives during this phase and format messages
for both the console and the error log, as appropriate.  Bounds and sanity
checks on the values of the MPM directives are handled in sequence in
this phase instead of in the various directive handling functions, since
those functions (e.g., set_max_clients()) may not be called at all if their
directives do not appear in the configuration files, and even if they
are called, there is no guarantee that this will occur in any particular
order.

Remove from the worker and event MPMs the code in the pre_config phase
that alters the configuration node tree by re-ordering ThreadsPerChild
ahead of MaxClients.  This code is effective but insufficient; for
example, if ServerLimit follows MaxClients, the test against server_limit
in set_max_clients() is invalid.  (In practice, this only results in
incorrect or absent warnings on the console, because server_limit is
set to its configured value when the main loop re-runs the configuration
process.)

Prevent ap_threads_per_child from exceeding thread_limit in the
winnt, worker, and event MPMs.  This situation could occur if
ThreadsPerChild was not specified in the configuration files and
ThreadLimit was set to a value smaller than DEFAULT_THREADS_PER_CHILD,
because set_threads_per_child() would never be called and therefore
its bounds check against thread_limit would not be performed.

Remove from the winnt, prefork, worker, and event MPMs the
changed_limit_at_restart flag.  Set the first_server_limit and
first_thread_limit values during the first execution of the check_config
function, and use them to detect changes to ServerLimit and ThreadLimit
across restarts and issue appropriately formatted warnings.  Remove the
comments about the error log being a "bit bucket"; this was true when
the code was originally committed in r92530 but that was due to a bug
fixed in r92769.

Be consistent about setting all MPM configuration directive values in the
pre_config phase.

Rephrase and reformat the console and log file messages relating to
MPM configuration directives to be consistent across all MPMs.  Use
briefer messages when logging to the error log than to the console.

Update miscellaneous stale comments and messages (e.g., reference to
daemons_min_free in worker and event MPMs, "prefork open_logs" in
winnt MPM, and StartServers in netware MPM).

The winnt, netware, beos, and mpmt_os2 MPMs should be tested by developers
with access to those platforms, especially the winnt MPM, which has
unique logic with respect to distinguishing between parent and child
processes during the configuration phases.

Update the English documentation for the worker MPM's ThreadsPerChild
directive, which no longer needs to precede other MPM directives in the
configuration files if it has a non-default value.  The German (.de) and
Japanese (.ja) translations should be updated by developers fluent in
those languages.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@431460 13f79535-47bb-0310-9956-ffa450edef68
2006-08-14 22:55:45 +00:00
Mladen Turk
36db918bc8 Fix return values from wait_for_many_objects.
The return value is index to the signaled thread in
the creted_threads array.
We can not use WAIT_TIMEOUT as return value
because its value is defined as 258, thus limiting
the MaxThreads to that value that leads to the
assertion errors.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@428029 13f79535-47bb-0310-9956-ffa450edef68
2006-08-02 15:31:24 +00:00
Mladen Turk
a409ec8829 Revert the patch. Although the problem still exists
its root cause is inside the wait_for_many_objects.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@428009 13f79535-47bb-0310-9956-ffa450edef68
2006-08-02 14:41:31 +00:00
Mladen Turk
da44990a05 Fix the assertion if the WaitForMutipleObjects
returns WAIT_ABANDONED_NN instead presumed
WAIT_OBJECT_NN. This will correctly close the thread
handle without using invalid thread handle array index.

Spotted when large balancer timeout was set
and all the threads were busy waiting for the
connection:
[Wed Aug 02 14:29:58 2006] [crit] [Wed Aug 02 14:29:58 2006] file \\build-2.2.2\\server\\mpm\\winnt\\child.c, line 1120, assertion "(rv >= 0) && (rv < threads_created)" failed


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@428008 13f79535-47bb-0310-9956-ffa450edef68
2006-08-02 14:36:24 +00:00
Roy T. Fielding
399bc245dd Fix warning on Darwin 8.7.0 (OS X 10.4.7) due to the prototype for
sendfile_nonblocking being declared outside ifdefs even though the
function is defined and used only when APR_HAS_SENDFILE



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@425571 13f79535-47bb-0310-9956-ffa450edef68
2006-07-26 00:40:53 +00:00
Ruediger Pluem
0255874634 * Although the lstat call should rarely ever fail, because we stat'ed the
same file several lines above, check the return value to be save that
  nothing bad happens in the case it does fail.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@425394 13f79535-47bb-0310-9956-ffa450edef68
2006-07-25 13:40:32 +00:00
Ruediger Pluem
f1c497a222 * Fix typo. No functional change.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@425057 13f79535-47bb-0310-9956-ffa450edef68
2006-07-24 14:09:27 +00:00
Ruediger Pluem
356d882a5d * Check for symbolic links of the target file in the optimized case that we
had already done this specific directory walk for this request. This can
  happen when we have an internal redirect, like the ones caused by mod_dir
  (/ -> index.html). See also

  http://mail-archives.apache.org/mod_mbox/httpd-dev/200607.mbox/%3c44B5521F.8050906@globalvanet.com%3e

Reviewed by: wrowe


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@423886 13f79535-47bb-0310-9956-ffa450edef68
2006-07-20 11:01:07 +00:00
Paul Querna
d26fded1ef gen_test_char doesn't actually need the util_debug object to work.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@422306 13f79535-47bb-0310-9956-ffa450edef68
2006-07-15 22:36:12 +00:00
Paul Querna
f9d3d9f6a5 Bring in basic support for building the winnt MPM under mingw32, using the autoconf build system. Currently this will get you to the point of linking errors on gen_test_char.
configure.in: Default to winnt MPM on mingw32 hosts.
configure.in: Add AP_DECLARE_EXPORT for mingw32 hsots.

os/config.m4: Use win32 dir under mingw32.
os/win32/Makefile.in: Add in a new makefile to generate libos on win32.

server/mpm/config.m4: Add winnt MPM to the help string.
server/mpm/config.m4: winnt MPM is a threaded MPM.

server/mpm/winnt/child.c: SO_UPDATE_ACCEPT_CONTEXT is defined under a different header in mingw32.

server/mpm/winnt/{Makefile.in,config.m4}: Base build for winnt MPM.

os/win32,server/mpm/winnt: Update svn:ignore for .deps/.libs

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@422182 13f79535-47bb-0310-9956-ffa450edef68
2006-07-15 09:03:52 +00:00
Roy T. Fielding
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
Ruediger Pluem
c93a4faef9 * Add the filename of the configuration file to the warning message
about the useless use of AllowOverride.

PR: 39992
Submitted by: Darryl Miles <darryl darrylmiles.org>
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@420307 13f79535-47bb-0310-9956-ffa450edef68
2006-07-09 16:19:41 +00:00
William A. Rowe Jr
5cd174cfcb Make the range test legible; in the process, uncover and close
a bounds overflow condition.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@417252 13f79535-47bb-0310-9956-ffa450edef68
2006-06-26 17:41:28 +00:00
Joe Orton
c13f8dd6eb * server/core.c (default_handler): Use apr_brigade_insert_file() to
append the file to the brigade.

* server/protocol.c (ap_send_fd),
modules/proxy/mod_proxy_http.c (spool_reqbody_cl), 
modules/cache/mod_mem_cache.c (recall_body),
modules/cache/mod_disk_cache.c (recall_body),
modules/mappers/mod_negotiation.c (handle_map_file),
modules/generators/mod_asis.c (asis_handler),
modules/dav/fs/repos.c [DEBUG_GET_HANDLER] (dav_fs_deliver),
modules/arch/win32/mod_isapi.c (ServerSupportFunction): Likewise.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@414238 13f79535-47bb-0310-9956-ffa450edef68
2006-06-14 13:16:29 +00:00
Chris Darroch
ab486bc088 On graceless shutdown or restart, send AP_SIG_GRACEFUL to all worker
threads so that any that are polling on Keep-Alive connections will
wake up and exit promptly.  Otherwise, on Linux, they wait until
poll()'s timeout interval completes, which is often too long for
the parent process; the parent issues SIGKILL before the child's main
thread manages to re-join all the worker threads.  PR 38737.

On Solaris, by contrast, the close_worker_sockets() function
successfully alerts all worker threads that they should exit quickly.
On Linux, this side-effect of one thread closing another's socket
doesn't occur; see:

http://bugme.osdl.org/show_bug.cgi?id=546

Also, expand on the placeholder in CHANGES regarding previous
cleanups to scoreboard.c and scoreboard.h in r404848 and r404849.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@409715 13f79535-47bb-0310-9956-ffa450edef68
2006-05-26 18:27:23 +00:00
Chris Darroch
b2ba96e340 Make the worker and event MPMs not touch the scoreboard when
handling a fork() failure.  The previous behaviour appears to have
been inherited from the prefork MPM, where is it appropriate.

The prefork MPM sets thread_limit to 1 and therefore each
child process has a single worker_score structure in the scoreboard's
array, i.e., ap_scoreboard_image->servers[slot][0].  In make_child(),
it sets this structure's status to SERVER_STARTING, and then does
a fork(); if the fork() fails, it resets the status to SERVER_DEAD.

The worker and event MPMs, by constrast, obviously use multiple
worker_score structures per child process.  They may also be
in use by worker threads from a previous generation at any particular
moment.  Therefore make_child() and the parent process in general
doesn't normally update them; make_child() doesn't set them all
to SERVER_STARTING before doing fork(), for example.

So, make_child() shouldn't set them to SERVER_DEAD if fork()
fails (and even if it should, it certainly shouldn't be just
updating the first one).



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@409693 13f79535-47bb-0310-9956-ffa450edef68
2006-05-26 16:26:52 +00:00
Joe Orton
8984444d42 * server/main.c (abort_on_oom): New function.
(create_process): Set abort callback for process pool.
(main): Set abort callback for global pool.

Reviewed by: colm


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@406953 13f79535-47bb-0310-9956-ffa450edef68
2006-05-16 14:17:02 +00:00
Joe Orton
b3f30e49c1 * server/mpm/prefork/prefork.c (child_main): Tag pchild.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@405721 13f79535-47bb-0310-9956-ffa450edef68
2006-05-10 11:51:41 +00:00
Martin Kraemer
be127bbaed Typo (..for use with by the scoreboard) changed to
"..for use by the scoreboard" (not 100% sure -- or
should it be "..for use with the scoreboard"?)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@405665 13f79535-47bb-0310-9956-ffa450edef68
2006-05-10 07:36:54 +00:00
Joe Orton
ed72b35485 * server/core.c (server_hostname_port): Remove unused variable.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@405010 13f79535-47bb-0310-9956-ffa450edef68
2006-05-08 10:57:49 +00:00
Nick Kew
691a99bd81 Initialise server generation (Chris Darroch)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@404850 13f79535-47bb-0310-9956-ffa450edef68
2006-05-07 21:03:39 +00:00
Nick Kew
d0e7d57212 Scoreboard size (Chris Darroch)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@404848 13f79535-47bb-0310-9956-ffa450edef68
2006-05-07 21:00:08 +00:00
Sander Temme
646a8ad3c8 Add optional 'scheme://' prefix to ServerName directive. For
'https', mod_http returns "https" for the ap_hook_http_scheme and
     DEFAULT_HTTPS_PORT for ap_hook_default_port.  This fixes Redirect
     responses to requests for directories without a trailing slash
     when httpd runs behind a proxy or offload device that processes
     SSL.  It also enables support for Subversion in that
     configuration.  This change is completely backwards compatible
     and passes the perl-framework.  Minor mmn bump because I add a
     field to server_rec. 


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@399947 13f79535-47bb-0310-9956-ffa450edef68
2006-05-05 04:17:36 +00:00
Greg Ames
0da0ca701b PR 39275. don't fork MaxClients worth of processes if child_init or fork() are
slow.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@399099 13f79535-47bb-0310-9956-ffa450edef68
2006-05-03 00:30:56 +00:00
William A. Rowe Jr
f65c47bd75 Remove all /machine:I386 references, these are getting in the way
of switching linkers from the x86 (default linker) to x64 or other
  possible target platforms.  (Also, this commit cleans up lingering
  /GX switches from the 'BASE' options that are supposed to be unused).

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@397407 13f79535-47bb-0310-9956-ffa450edef68
2006-04-27 05:30:39 +00:00
Roy T. Fielding
34487c8eb9 revert last change
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@395421 13f79535-47bb-0310-9956-ffa450edef68
2006-04-19 22:52:45 +00:00
William A. Rowe Jr
663687ae8e s|/GX |/EHsc | because they were always synonyms, and Visual Studio
2005 edition complains bitterly and loudly that /GX is deprecated.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@395419 13f79535-47bb-0310-9956-ffa450edef68
2006-04-19 22:51:02 +00:00
Ruediger Pluem
8cca196973 * Adjust comment as per niq's proposal in r395166 and as already adjusted by
colm in the backport to 2.0.x (r395197).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@395381 13f79535-47bb-0310-9956-ffa450edef68
2006-04-19 20:07:22 +00:00
Colm MacCarthaigh
ebe24d48c7 Update the last year of copyright.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@395229 13f79535-47bb-0310-9956-ffa450edef68
2006-04-19 12:23:42 +00:00
Colm MacCarthaigh
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
Greg Ames
9f83736b37 decouple the two scoreboard full messages
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@394116 13f79535-47bb-0310-9956-ffa450edef68
2006-04-14 15:12:35 +00:00
Ruediger Pluem
4d1b38642d * Initialize last_char as otherwise a random value will be compared
against APR_ASCII_LF at the end of the loop if bb only contains an
  EOS bucket.

PR: 39282
Submitted by: Davi Arnaut <davi haxent.com.br>
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@394070 13f79535-47bb-0310-9956-ffa450edef68
2006-04-14 12:17:54 +00:00
Greg Ames
801bb0266a MaxClients isn't the only reason the scoreboard can fill up. another
reason should be fixed soon.

also add a comment to explain an obscure line of code.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@393868 13f79535-47bb-0310-9956-ffa450edef68
2006-04-13 17:53:04 +00:00
Ruediger Pluem
df91b29fd7 * Rollback r393037 as this was vetoed by wrowe. Details see
http://mail-archives.apache.org/mod_mbox/httpd-dev/200604.mbox/%3c443ABE65.1060603@rowe-clan.net%3e


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@393087 13f79535-47bb-0310-9956-ffa450edef68
2006-04-10 22:07:02 +00:00
Ruediger Pluem
d6f4ab7bfa * Prevent r->parsed_uri.path from being NULL as this can cause segmentation
faults e.g. in mod_cache. Set it to "/" in this case.

PR: 39259
Submitted by: Davi Arnaut <davi haxent.com.br>
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@393037 13f79535-47bb-0310-9956-ffa450edef68
2006-04-10 19:59:33 +00:00
Jeff Trawick
b051891cc9 remove unnecessary whitespace
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@393001 13f79535-47bb-0310-9956-ffa450edef68
2006-04-10 17:54:59 +00:00
Jim Jagielski
6a67ac6885 We actually want to reach the rest of the code :)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@391025 13f79535-47bb-0310-9956-ffa450edef68
2006-04-03 12:10:22 +00:00
Jeff Trawick
eb89d4733f Default handler: Don't return output filter apr_status_t values.
PR: 31759
Helped by: Ruediger Pluem, Joe Orton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@390922 13f79535-47bb-0310-9956-ffa450edef68
2006-04-02 23:36:27 +00:00
William A. Rowe Jr
4a60c07a94 With all of the, uhm, interesting manners in which httpd
can be built and installed, let's ensure httpd -V gives the
  reporter a chance to identify the APR flavor used to compile
  and to run httpd when reporting bugs.
  

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@390573 13f79535-47bb-0310-9956-ffa450edef68
2006-04-01 02:48:24 +00:00
William A. Rowe Jr
34cb5fbc3f uri_delims moved to apr-util EONS ago.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@384622 13f79535-47bb-0310-9956-ffa450edef68
2006-03-09 21:29:20 +00:00
Brian Pane
761ef9ee17 Revert the refactoring of the request read code
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@381679 13f79535-47bb-0310-9956-ffa450edef68
2006-02-28 15:49:24 +00:00
Garrett Rooney
581e95cffc Fill in the scoreboard's tid field in the event MPM, just like we do in
other MPMs.

Submitted by: Chris Darroch <chrisd pearsoncmg.com>
Issue: 38736

* server/mpm/experimental/event/event.c
  (worker_thread): Fill in the scoreboard's tid field.

* CHANGES: Note change.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@380878 13f79535-47bb-0310-9956-ffa450edef68
2006-02-25 00:59:04 +00:00
Garrett Rooney
b458b88d15 Make the worker and event MPMs support GracefulShutdownTimeout just like
the prefork MPM does.

Submitted by: Chris Darroch <chrisd pearsoncmg.com>
Ported to event MPM by: rooneg
Issue number: 38621

* server/mpm/worker/worker.c
  (ap_mpm_run): Make the graceful shutdown log message refer to the right
   signal, and respect the graceful shutdown timeout if there is one.

* server/mpm/experimental/event/event.c
  (ap_mpm_run): Ditto.

* CHANGES: Note change.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@377291 13f79535-47bb-0310-9956-ffa450edef68
2006-02-13 02:25:53 +00:00
William A. Rowe Jr
d3e8acd0a5 Solaris build proposal; don't fail on missing .h files within
a VPATH build, and don't test trees with -d (simply -f the
  expected files) in case a tree such as srclib/apr is actually
  a symlink rather than a true directory in ./buildconf.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@374821 13f79535-47bb-0310-9956-ffa450edef68
2006-02-04 02:41:02 +00:00
Ruediger Pluem
4befe87504 * Improve fix for PR38123. This fixes PR38123 and PR37790 (whose fix has been
already backported) by inserting the HTTP_IN filter uncondionally before
  we call ap_send_error_response or ap_die. This ensures that
  ap_discard_request_body called by ap_die and by ap_send_error_response works
  correctly on status codes that do not cause the connection to be dropped and
  in situations where the connection should be kept alive.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@371132 13f79535-47bb-0310-9956-ffa450edef68
2006-01-21 23:22:23 +00:00
Nick Kew
36013888ad PR#38070: When a CGI script emits an explicit "Status:" header,
it takes charge, so we shouldn't use ap_meets_conditions.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@370692 13f79535-47bb-0310-9956-ffa450edef68
2006-01-20 01:36:44 +00:00
Ruediger Pluem
44c8981aac * Fix PR38123 by adding the HTTP_IN filter also in the case of an invalid
expect header.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@370172 13f79535-47bb-0310-9956-ffa450edef68
2006-01-18 16:04:13 +00:00
Garrett Rooney
668a5863a7 Make some error checking more clear by using the defined constants instead
of literal values.

Patch by: Dan Rall <dlr apache.org>

* server/request.c
  (ap_process_request_internal): Check the return value of hook functions
   against the constant OK instead of the magic number 0 to improve clarity.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@368505 13f79535-47bb-0310-9956-ffa450edef68
2006-01-12 22:51:00 +00:00