1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-05 05:30:39 +03:00
Commit Graph

463 Commits

Author SHA1 Message Date
William A. Rowe Jr
b2e122738e Use a better name for the APR_SENDFILE_ENABLE flag.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97211 13f79535-47bb-0310-9956-ffa450edef68
2002-10-14 20:08:15 +00:00
William A. Rowe Jr
a1ef1921c7 Introduce an EnableSendfile directive (defaulted to ON) to allow users
to disable sendfile mechanics for NFS volume mounts and other kernel
  objects that don't support sendfile.  And EnableSendfile off can be used
  to help narrow bugs down to the sendfile mechanics or eliminate the
  possiblity that sendfile is a factor on any given platform.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97205 13f79535-47bb-0310-9956-ffa450edef68
2002-10-14 17:42:45 +00:00
William A. Rowe Jr
e9782db913 What once were macros no longer need line continuation
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97192 13f79535-47bb-0310-9956-ffa450edef68
2002-10-13 18:22:55 +00:00
Greg Stein
72f0111ad8 Add logic to the default_handler to enable script delivery to script
processors located in the output filter stack. This is on by default,
but will change "soon" to off -- the processors will then need to
enable it when they are installed into the filter chain.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97065 13f79535-47bb-0310-9956-ffa450edef68
2002-10-03 00:16:47 +00:00
William A. Rowe Jr
01b9944772 *) SECURITY: [CAN-2002-0840] HTML-escape the address produced by
ap_server_signature() against this cross-site scripting
     vulnerability exposed by the directive 'UseCanonicalName Off'.
     Also HTML-escape the SERVER_NAME environment variable for CGI
     and SSI requests.  It's safe to escape as only the '<', '>',
     and '&' characters are affected, which won't appear in a valid
     hostname.  Reported by Matthew Murphy <mattmurphy@kc.rr.com>.
     [Brian Pane]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97064 13f79535-47bb-0310-9956-ffa450edef68
2002-10-02 21:35:57 +00:00
William A. Rowe Jr
7fd6a8c450 Until we have a mechanism to allow PHP and others to 'raise their hand'
and claim 'POST' we have to continue to accept POST in the default
  handler.  Revert to rev 1.206 per Rbb's and wrowe's veto.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97063 13f79535-47bb-0310-9956-ffa450edef68
2002-10-02 21:32:01 +00:00
Greg Stein
8b8a1baba5 Fix bug in the default handler. POST is not allowed on regular files.
The resource must be handled by something *other* than the default
handler.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97046 13f79535-47bb-0310-9956-ffa450edef68
2002-10-01 16:24:41 +00:00
Ryan Bloom
a8e87256bf Call out the success cases when we don't get APR_SUCCESS back from the
network write.  All other status codes result in c->aborted being set,
which allows the logs to note that the connection was aborted.  Previous
to this patch, if the network cable was unplugged on the client, the server
would get APR_ETIMEUP, but we wouldn't note that the connection was
aborted.

Submitted by:	Ryan Morgan <rmorgan@covalent.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97038 13f79535-47bb-0310-9956-ffa450edef68
2002-09-30 23:43:18 +00:00
Jeff Trawick
b428e822db zap a gcc warning about using an uninitialized variable (new) and
check for a possible syntax error


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96836 13f79535-47bb-0310-9956-ffa450edef68
2002-09-16 13:11:55 +00:00
William A. Rowe Jr
c5b0867a95 Modify ap_open_logs (an internal function) to follow the hook open_logs
argument schema so it can be directly invoked by the hook handler.  Also
  clean up the open_logs processing to return an error rather than simply
  exit()ing.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96829 13f79535-47bb-0310-9956-ffa450edef68
2002-09-15 22:04:01 +00:00
Justin Erenkrantz
92b395d754 Allow AddOutputFilterByType to take in multiple filters.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96819 13f79535-47bb-0310-9956-ffa450edef68
2002-09-15 00:30:56 +00:00
Justin Erenkrantz
13a0a92e12 Fix memory leak in core_output_filter.
This would result in at least two EOS buckets being leaked per connection.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96752 13f79535-47bb-0310-9956-ffa450edef68
2002-09-10 19:41:43 +00:00
Ian Holsman
a525e2a5ad Major/Minor/Min[imal]
now working as one (with a sane mind) would thing it should


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96501 13f79535-47bb-0310-9956-ffa450edef68
2002-08-23 18:05:38 +00:00
Ian Holsman
df6a0c3e94 new option to ServerTokens. "Maj[or]" which displays a server response
similar to Apache/2.0

Also surfaced the directive in the standard config, defaulting to FULL


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96500 13f79535-47bb-0310-9956-ffa450edef68
2002-08-23 17:24:39 +00:00
Brian Pane
89dd7d9c9d Zero-copy output for small files delivered over keepalive
connections (previously, the setaside code in the core output
filter would copy file buckets <8KB into the heap, resulting
in poor keepalive performance)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96431 13f79535-47bb-0310-9956-ffa450edef68
2002-08-18 07:16:01 +00:00
William A. Rowe Jr
e925d0a202 Pardon je, it seems the most obvious solutions are always the easiest
to incorporate new bugs.  Solve the 0index.html bad uri bug.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96316 13f79535-47bb-0310-9956-ffa450edef68
2002-08-06 20:02:07 +00:00
William A. Rowe Jr
3653eaa40e This was never a 'vulnerability'... the APR_FILEPATH_SECUREROOT flag
passed to apr_filepath_merge refused to merge any rooted 'addpath'.
  However, that isn't the traditional 1.3 behavior, so fly past any
  leading '/'s on the way to merging the uri to the DocumentRoot.

PR: 10946


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96314 13f79535-47bb-0310-9956-ffa450edef68
2002-08-06 16:27:36 +00:00
Ian Holsman
705f189757 format to 80 chars
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96303 13f79535-47bb-0310-9956-ffa450edef68
2002-08-04 15:15:57 +00:00
William A. Rowe Jr
6b69fe06c0 Timeout/time fixes
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96055 13f79535-47bb-0310-9956-ffa450edef68
2002-07-15 07:46:19 +00:00
Jeff Trawick
c173b5078d spell check a comment
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95991 13f79535-47bb-0310-9956-ffa450edef68
2002-07-10 01:07:21 +00:00
William A. Rowe Jr
2604f8bdbb Changes for deprecated apr_is_fnmatch
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95976 13f79535-47bb-0310-9956-ffa450edef68
2002-07-08 17:43:34 +00:00
Ian Holsman
6deba78a9a Renames Pending:
This clears the list of renames pending in apr-util.
 Parts of this list was alreadu done, but the pending list hadn't been updated.

 apr_hook_debug_current     from apr_current_hooking_module
 apr_hook_debug_show        from apr_show_hook

 apr_hook_global_pool       from apr_global_hook_pool
 apr_hook_sort_all          from apr_sort_hooks

 apr_uri_port_of_scheme     from apr_uri_default_port_for_scheme
 apr_uri_unparse            from apr_uri_unparse_components
 apr_uri_parse              from apr_uri_parse_components
 apr_uri_parse_hostinfo     from apr_uri_parse_hostinfo_components

 apr_uri_t                  from apr_uri_components

 All APR_URI_*              from all APU_URI_* symbols
 All APR_UNP_*              from all UNP_* symbols

PR:
Obtained from:
Submitted by:	 Thom May
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95966 13f79535-47bb-0310-9956-ffa450edef68
2002-07-06 20:04:38 +00:00
Sander Striker
62faca71e7 Add a new directive: MaxMemFree. MaxMemFree makes it possible
to configure the maximum amount of memory the allocators will
hold on to for reuse.  Anything over the MaxMemFree threshold
will be free()d.  This directive is usefull when uncommon large
peaks occur in memory usage.  It should _not_ be used to mask
defective modules' memory use.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95954 13f79535-47bb-0310-9956-ffa450edef68
2002-07-04 15:20:54 +00:00
Brian Pane
8c86d4bf88 Optimized the addition of the core output filter
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95941 13f79535-47bb-0310-9956-ffa450edef68
2002-07-02 21:40:13 +00:00
Brian Pane
d6baa119a0 Replaced ap_add_input_filter() call with cheaper ap_add_input_filter_handle()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95940 13f79535-47bb-0310-9956-ffa450edef68
2002-07-02 21:35:19 +00:00
Justin Erenkrantz
798c1dae43 Add a filter_init function to the filters so that a filter can execute
arbitrary code before the handlers are invoked.

This resolves an issue with incorrect 304s on If-Modified-Since mod_include
requests since ap_meets_conditions() is not aware that this is a dynamic
request and it is not possible to satisfy 304 for these requests (unless
xbithack full is on, of course).  When mod_include runs as a filter, it is
too late to set any flag since the handler is responsible for calling
ap_meets_conditions(), which it should do before generating any data.

If a module doesn't need to run such arbitrary code, it can just pass NULL
as the argument and all is well.

PR:	9673
Reviewed by:	Ryan Bloom and others


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95906 13f79535-47bb-0310-9956-ffa450edef68
2002-06-28 08:40:25 +00:00
Justin Erenkrantz
561d4c3874 Strengthen error-detection code in HTTP_IN and core_input_filter so that
invalid readbytes or errors reading brigades are properly handled.

Reviewed by:	Brian Pane


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95897 13f79535-47bb-0310-9956-ffa450edef68
2002-06-27 05:18:19 +00:00
Justin Erenkrantz
518af3ff49 - Fix segfault in core_output_filter when we are passed an empty brigade.
- Stash the remainder of the brigade in more when we see a flush bucket.
  Previous to this commit, we would only process the buckets before the
  flush on a HTTP/1.0 request and then return.

We are proably only finding this now since we now correctly check for
keepalive connection status.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95896 13f79535-47bb-0310-9956-ffa450edef68
2002-06-27 05:00:23 +00:00
Justin Erenkrantz
001b387bcd Change conn_rec->keepalive to an enumerated value of
AP_CONN_UNKNOWN
AP_CONN_CLOSE
AP_CONN_KEEPALIVE

This also fixes a problem where ap_discard_request_body would not discard
the body when keepalive was 0.  This actually meant the keepalive status
was unknown *not* closed, but no one ever remembered that.

This problem was seen with mod_dav sending error responses (as reported by
Karl Fogel).

Suggested by:	Greg "this isn't the '80s" Stein
Reviewed by:	Greg Ames


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95891 13f79535-47bb-0310-9956-ffa450edef68
2002-06-26 19:45:07 +00:00
Ryan Bloom
4db278ffc8 Make the default_handler catch all requests that aren't served by
another handler.  This also gets us to return a 404 if a directory
is requested, there is no DirectoryIndex, and mod_autoindex isn't
loaded.

PR:	8045
Submitted by:	Justin Erenkrantz


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95690 13f79535-47bb-0310-9956-ffa450edef68
2002-06-15 05:49:06 +00:00
William A. Rowe Jr
7af68c0bf5 Solve the 80/20 by initializing and storing server_rec->timeout and
server_rec->keep_alive_timeout in apr_time_interval_t format (in apr
  units, whatever they be), as both values exist to pass into APR, and
  all APR timeouts are in apr_time_t.

Reviewed by:	Cliff Woolley


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95623 13f79535-47bb-0310-9956-ffa450edef68
2002-06-12 23:59:31 +00:00
Ryan Bloom
ca5fd7fb7b The apr_bucket change requires a minor MMN bump. Also modify Apache's
filters to use APR_BUCKET_IS_METADATA macro.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95454 13f79535-47bb-0310-9956-ffa450edef68
2002-05-31 20:52:28 +00:00
William A. Rowe Jr
4f93d4762c Resolve the EXEC_ON_READ bit for ServerRoot and other modules that test
the directive context.  Should eliminate the segfault.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95171 13f79535-47bb-0310-9956-ffa450edef68
2002-05-18 17:22:23 +00:00
William A. Rowe Jr
d9f47b5bc4 Although it appears reasonable to immediately gather the Error log and
level from the config; these are per-vhost entities that can't be
  processed as we preload the config tree.  There is more work to do,
  as Cliff Woolley guesses, before we can make this change.
  In the meantime, -e and -E should provide the admin sufficient options
  to work around problematic configs.  So I'm reverting those changes,
  for now.

  ServerRoot is global only, and it MUST be read immediately, so that
  part of the last patch stays.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95170 13f79535-47bb-0310-9956-ffa450edef68
2002-05-18 16:35:57 +00:00
Cliff Woolley
81c03e82c4 Renames:
APR_XtOffset   -> APR_OFFSET
  APR_XtOffsetOf -> APR_OFFSETOF


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95164 13f79535-47bb-0310-9956-ffa450edef68
2002-05-18 04:13:13 +00:00
William A. Rowe Jr
eb3ac00c5f We need to grab ServerRoot, LogLevel, and ErrorLog right off the bat
as we are reading the config.

  This closes a bug where ServerRoot /foo + LoadModule relative/mod_foo.so
  won't load mod_foo.so.

Reported by: Ron Leung <rleung@covalent.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95160 13f79535-47bb-0310-9956-ffa450edef68
2002-05-17 19:34:52 +00:00
Jeff Trawick
c871b41d3c stop using APLOG_NOERRNO in calls to ap_log_?error()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95149 13f79535-47bb-0310-9956-ffa450edef68
2002-05-17 11:11:39 +00:00
Brian Pane
d74c4014cc Added EnableMMAP directive to allow the server administrator to
prevent mmap of file buckets upon read.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95040 13f79535-47bb-0310-9956-ffa450edef68
2002-05-11 23:24:29 +00:00
Brian Pane
bc90009198 Moved ap_setup_make_content_type() declaration to http_protocol.h
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95031 13f79535-47bb-0310-9956-ffa450edef68
2002-05-10 15:08:59 +00:00
Brian Pane
7e2c4f3a54 Performance fix: replaced the strcasecmp calls in ap_make_content_type()
with apr_strmatch()


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95026 13f79535-47bb-0310-9956-ffa450edef68
2002-05-10 06:47:13 +00:00
Greg Ames
4c4ea8b348 default_handler: move the code to handle unusual methods out of the middle
of the hot path without using goto.

suggested by: Roy Fielding


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94882 13f79535-47bb-0310-9956-ffa450edef68
2002-04-30 20:12: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
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
William A. Rowe Jr
e5200732d3 Correct partitioning of filter handles between core and http, and
export the handle pointers on Win32.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94468 13f79535-47bb-0310-9956-ffa450edef68
2002-04-05 20:55:00 +00:00
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
Ryan Bloom
f44773343a We have to return valid HTTP status codes from filters. This fixes two
cases in the core_output_filters where there was a problem, and the core
returned an error code instead of an HTTP status code.  This keeps us from
putting status codes like 32 and 104 in the access log.

Submitted by:	Ryan Morgan <rmorgan@covalent.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94143 13f79535-47bb-0310-9956-ffa450edef68
2002-03-22 21:45:44 +00:00
Jim Jagielski
730e99e461 Fold the compiled-in knowledge of the allowable AcceptMutex settings into
its help entry. Requires the use of a extern string rather than a function
call for the initialization to be valid in the macro (Thx to Jeff!).
In the meantime, bump down the error logging until we deal with true
default and configured setting information ala 1.3.

PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94062 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 22:19:11 +00:00
Bill Stoddard
76bef9981f Commit 2 of 2 to:
1. rename ap_rset_content_type to ap_set_content_type
2. reverse the arguments to aligh with ap_set_content_length


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94057 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 17:44:13 +00:00
Bill Stoddard
e9ec908a01 Final commit to add ap_rset_content_type accessor. Add AddOutputFiltersbyType
filters during call to ap_rset_content_type()


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94028 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 02:05:43 +00:00