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

233 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
Brian Pane
7d55deceea Allow variable expansion within in the "var" arg to <!--#echo
and <!--#set, so that people can do things like this:
  <!--#echo var="${foo}_${bar}" -->


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94294 13f79535-47bb-0310-9956-ffa450edef68
2002-03-29 05:58:39 +00:00
Brian Pane
54ae6c947e Replaced my fix for the is_only_below() bug with Cliff's faster
and simpler version.
Submitted by:	Cliff Woolley


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94291 13f79535-47bb-0310-9956-ffa450edef68
2002-03-29 04:47:10 +00:00
Brian Pane
440d5f0751 Fixes for three problems in mod_include:
* The ctx->tag_length computation in find_end_sequence() was a bit
    broken in cases where there was a "false alarm" match on a partial
    "-->"
  * The ap_ssi_get_tag_and_value() function needs to avoid walking off
    the end of the string.  After debugging this some more, I ended up
    using Cliff's original patch.
  * Infinite loop in is_only_below()


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94284 13f79535-47bb-0310-9956-ffa450edef68
2002-03-29 02:14:45 +00:00
Bradley Nicholes
1f31c48ce1 Stop the while loop from incrementing twice per iteration before checking for
the NULL terminator.  This was causing the while loop to walk off the end of any
string with an odd number of characters.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94276 13f79535-47bb-0310-9956-ffa450edef68
2002-03-29 00:39:56 +00:00
Brian Pane
7f7d0c040f Revert my last fix, which broke more things than it fixed
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94254 13f79535-47bb-0310-9956-ffa450edef68
2002-03-28 01:57:03 +00:00
Brian Pane
832f28d371 Don't walk past the end of the tag in ap_ssi_get_tag_and_value()
Discovered by: Cliff Woolley


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94251 13f79535-47bb-0310-9956-ffa450edef68
2002-03-28 01:19:58 +00:00
Bill Stoddard
527d4fc537 ap_run_sub_req does not return apr_status, so we shouldn't be checking
APR_STATUS_IS_EPIPE(). Also, remove the code that assumed the sub_req_lookup_uri
actually served up the content in the quick handler. We now call the quick_handler
in ap_run_sub_req()


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94248 13f79535-47bb-0310-9956-ffa450edef68
2002-03-28 01:05:24 +00:00
Brian Pane
f75049a4b1 Small performance optimization for find_end_sequence(): when we find
the start of a directive, scan through the rest of it in a minimal
loop before popping back out to the main char-at-a-time parser loop


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94153 13f79535-47bb-0310-9956-ffa450edef68
2002-03-24 06:42:14 +00:00
Bill Stoddard
d5c24720dc Commit 1 of 2 to:
1. rename ap_rset_content_type to ap_set_content_type
2. reverse the arguments on the call to aligh with ap_set_content_length


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94056 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 17:41:55 +00:00
Bill Stoddard
470edb9dd8 First commit to introduce accessor function to set r->content_type..
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94027 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 01:58:47 +00:00
Brian Pane
c6f154af33 Performance fix for ap_ssi_get_tag_and_value: do a lightweight
scan through the tag value until/unless we reach a backslash
that necessitates the more complicated scanner loop.  In cases
where there isn't a backslash in the tag value, this reduces
the overhead of the scan from 5 comparisons per character to 3.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93983 13f79535-47bb-0310-9956-ffa450edef68
2002-03-17 17:35:39 +00:00
Brian Pane
908c6dec75 Another optimization for find_end_sequence: once we're in the
middle of parsing a tag, consume the entire tag in a quick loop,
rather than jumping back to the outer state-machine loop for
each character


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93979 13f79535-47bb-0310-9956-ffa450edef68
2002-03-17 06:31:22 +00:00
Brian Pane
f70f782273 Small performance improvement for find_end_sequence()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93978 13f79535-47bb-0310-9956-ffa450edef68
2002-03-17 06:04:33 +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
Jeff Trawick
52e9962a8e fix the remaining sizeof(token.value) bogosity
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93917 13f79535-47bb-0310-9956-ffa450edef68
2002-03-13 20:41:48 +00:00
Jeff Trawick
0d850d0b4c Fix some mod_include bugs which broke the evaluation of some expressions.
There are a few instances of the same basic problem which are not yet
fixed and which I have marked with /* XXX.*FUBAR*/.

PR:      10108


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93916 13f79535-47bb-0310-9956-ffa450edef68
2002-03-13 20:32:28 +00:00
Ian Holsman
0536b99534 new directive SSIUndefinedEcho.
this allows webadmins to change the default '(none)' to something
a bit more presentable (eg <!-- undef -->)
PR:
Obtained from: Rex (the hack he had to fix this was so ugly I was forced to do this)
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93788 13f79535-47bb-0310-9956-ffa450edef68
2002-03-08 04:14:26 +00:00
Justin Erenkrantz
3058b601ff As hinted on dev@httpd, change filter naming schemes to match our
expectations of their usage.

The reason that we should make this change now is that we have changed
the implied meaning of AP_FTYPE_HTTP_HEADER - some users of this should
be PROTOCOL while others should be CONTENT_SET.  In order to clarify it,
toss all of the bogus names and force the filter writers to make sure
they understand what they are doing.

CONTENT_SET is new (horrible name - change if you have better idea), but
it indicates that it should run between RESOURCE and PROTOCOL.
mod_deflate is the ideal CONTENT_SET filter.

The changed type names are:
CONTENT is now RESOURCE.
HTTP_HEADER is now PROTOCOL.  However, most filters that used HTTP_HEADER
may want CONTENT_SET.  (Only things like POP and HTTP belong as PROTOCOL.)

MMN bump since all filters need to be recompiled due to filter reordering.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93756 13f79535-47bb-0310-9956-ffa450edef68
2002-03-07 09:27:17 +00:00
Cliff Woolley
26767a1313 Paren-protect macro arguments when used. (This will be needed later when
the bucket api gets changed.)

Submitted by: Brian Pane


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93678 13f79535-47bb-0310-9956-ffa450edef68
2002-03-03 00:36:07 +00:00
Cliff Woolley
e96865b046 Use the new APR_BRIGADE_PREPEND() macro
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93650 13f79535-47bb-0310-9956-ffa450edef68
2002-02-28 23:24:08 +00:00
Brian Pane
9629bb9e6b Fix for the code that handles SSI tokens that span multiple
buckets: if a brigade containing an incomplete "<!--#" token
has been set aside in ctx->ssi_tag_brigade, we need to retrieve
and output the contents of that brigade if the next bucket (in
the next brigade) doesn't actually complete the "<!--#".

As part of this commit, I've commented out the recent changes
to detect flush buckets in the brigade, due to segfaults.  (I
think the fix may be to add some checks for sentinels and EOS
when advancing to the next bucket after the flush bucket.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93557 13f79535-47bb-0310-9956-ffa450edef68
2002-02-24 07:40:05 +00:00
Ian Holsman
1c56d5b9d3 notes need to be 'set' at the main requests pool
not the 'sub-request' as notes live in the parent's request
lifetime.

PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93556 13f79535-47bb-0310-9956-ffa450edef68
2002-02-24 04:47:22 +00:00
Ian Holsman
13f6719a12 baby steps
this fixes the case where we have a SSI start tag split up
over multiple buckets.

BTW
HTTPD-test is failing.
but it was failing on 2.0.32 version of mod-include as well


PR:
Obtained from:
Submitted by:	Brian Pane
Reviewed by:	Ian Holsman


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93555 13f79535-47bb-0310-9956-ffa450edef68
2002-02-24 00:34:14 +00:00
Ian Holsman
d409bcf7e8 make it work with flushes
make the false alarm not as generic
PR:
Obtained from:
Submitted by:
Reviewed by:	 Ian, Brian, Justin


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93553 13f79535-47bb-0310-9956-ffa450edef68
2002-02-23 20:56:36 +00:00
Ian Holsman
a3cd5f06e2 fix problem where a unmatched tag was not sent if it was at the
end of a bucket


Obtained from: Alla Teper noticed it
Submitted by:
Reviewed by:	Cliff/Justin


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93532 13f79535-47bb-0310-9956-ffa450edef68
2002-02-21 16:18:11 +00:00
Ian Holsman
9387a9974d These changes are to allow caching of subrequests via a quick_handler.
* Change SUBREQ_CORE so that it is a HTTP_HEADER (20) filter instead of a content filter (10)
  this allows subrequests to add content filters properly

* Change subreq handling of 'handle-include' so that it splits/passes the brigade before the subreq
  is created. (This allows quick_handler to push content back from this phase)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92956 13f79535-47bb-0310-9956-ffa450edef68
2002-01-21 01:43:30 +00:00
Jeff Trawick
897a0d3f3b Fix a segfault in mod_include which was found by Sander Striker using
an APR_POOL_DEBUG/ElectricFence build.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92914 13f79535-47bb-0310-9956-ffa450edef68
2002-01-18 21:38:12 +00:00
Brian Pane
bcfa8dbb28 Removed the creation of a temporary pool in the expression parsing
code.  Now that the code no longer allocs huge buffers (based on the
last commit), there's no need to incur the overhead of creating a
temporary pool just to clean up the storage quickly.  This saves
a lot of space (because the temp pool used 8KB) and a small amount
of processing time.

As a side-effect of this change, we don't need the gotos any longer.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92839 13f79535-47bb-0310-9956-ffa450edef68
2002-01-13 06:34:10 +00:00
Brian Pane
dd1a8d5ce5 Allocate only as much data as we need to hold token values in the
"<!--#if" processing code, rather always allocating an 8KB structure


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92838 13f79535-47bb-0310-9956-ffa450edef68
2002-01-13 06:06:52 +00:00
William A. Rowe Jr
aff1454d34 *) Split all Win32 modules [excluding the core components mod_core,
mod_so, mod_win32 and the winnt mpm] into individual loadable
     modules, so the administrator may individually disable the former
     compiled-in modules by simply commenting out their LoadModule
     directives.  [William Rowe]

  *) Saved Win32 module authors and porters many future headaches, by
     duplicating the appropriate .h files such as os.h into the include
     directory, including in the build tree.  [William Rowe]

  Also noticed that version stamp resources weren't generated for proxy
  modules, this too is now fixed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92804 13f79535-47bb-0310-9956-ffa450edef68
2002-01-10 08:47:23 +00:00
Brian Pane
fb748619eb Cleaned up a couple of ap_ssi_parse_string calls that I missed
in the last commit


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92748 13f79535-47bb-0310-9956-ffa450edef68
2002-01-06 06:53:25 +00:00
Brian Pane
c4e9b1f0a1 Eliminated various large (8KB) string buffers from the stack in
mod_include by adding support for a power-of-two pool-based allocator
in ap_ssi_parse_string(). (The default operation of this function
is backward-compatible, to support the other modules that call it.)
This change should help reduce memory usage for servers delivering
shtml pages.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92747 13f79535-47bb-0310-9956-ffa450edef68
2002-01-06 06:41:30 +00:00
William A. Rowe Jr
5eba95eca5 Saw this bug several hours ago, but it slipped my mind. We no longer
skip over the leading '/' character, since the token_re already strips
  the / delimiters.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92683 13f79535-47bb-0310-9956-ffa450edef68
2001-12-31 06:47:28 +00:00
William A. Rowe Jr
bba58f292f Return the correct $n result (assign the val, not the var!)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92682 13f79535-47bb-0310-9956-ffa450edef68
2001-12-31 06:43:30 +00:00
William A. Rowe Jr
ca5a760f74 To provide more flexibility in handling quotes, allow the backtick quote
for SSI tag arguments (e.g. <!--#echo val=`foo` -->).  This helps with
  arguments containing both single and double quotes.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92678 13f79535-47bb-0310-9956-ffa450edef68
2001-12-31 06:04:45 +00:00
William A. Rowe Jr
26dc01e49f We never test for success in memory allocation
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92677 13f79535-47bb-0310-9956-ffa450edef68
2001-12-31 06:01:09 +00:00
William A. Rowe Jr
453e7e7c54 Ever tried to extract some value of QUERY_STRING from within SSI?
Now you can :)  Provides $0..$9 results for any regex evaluation,
  and strengthens the expr parser for regex expressions.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92676 13f79535-47bb-0310-9956-ffa450edef68
2001-12-31 05:58:59 +00:00
Ian Holsman
10577e4666 allow mod_include to handle different start/end tags instead of the default
<!-- --> ones.

PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92660 13f79535-47bb-0310-9956-ffa450edef68
2001-12-30 06:51:21 +00:00
Brian Pane
a4f324bdde Use r->content_type instead of r->handler to screen out non-html
requests when doing the xbithack check (thanks to wrowe for the
suggestion)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92654 13f79535-47bb-0310-9956-ffa450edef68
2001-12-30 01:24:14 +00:00
Brian Pane
b3c43f2cf3 Fix to make xbithack work again
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92652 13f79535-47bb-0310-9956-ffa450edef68
2001-12-29 21:34:04 +00:00
William A. Rowe Jr
67a4ced881 Improvements suggested by Brian Pane, first assure all OS's get to deal
with handler 'server-parsed', do the xbithack bit tests before testing
  it's string values (protected against a null point).

  And make it [perhaps] more legible.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92642 13f79535-47bb-0310-9956-ffa450edef68
2001-12-28 17:44:28 +00:00
William A. Rowe Jr
c5c552cb90 Context mustn't be transformed in the insert_filters hook, it merely
provides a point to insert filters already determined.  We can't wait
  for the insert_filters phase to 'redetermine' such things.

  Everything we are doing here can reliably occur in the fixup phase,
  after the types phase has completed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92640 13f79535-47bb-0310-9956-ffa450edef68
2001-12-28 17:12:20 +00:00
William A. Rowe Jr
2dbdd306b1 Another example, wherein our example in code/conf doesn't match our
recommended practices


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92639 13f79535-47bb-0310-9956-ffa450edef68
2001-12-28 17:09:52 +00:00
Brian Pane
2f4f8c5fa1 Rearranged the code in mod_include's BNDM string-search function
for faster execution.

This new code short-circuits out of the inner scanning loop
after a single comparison when it hits a character not in the
"<!--#" pattern.  Compared to the previous code, this version
does more work for characters in the pattern and less work for
characters not in the pattern.  In practice, the net result
seems to be a speedup for typical shtml files, where characters
in the pattern are less common than characters not in the pattern.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92604 13f79535-47bb-0310-9956-ffa450edef68
2001-12-26 12:07:55 +00:00
Brian Pane
5767efce12 cleaned up bucket types and removed the extraneous clearing of a buffer
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92496 13f79535-47bb-0310-9956-ffa450edef68
2001-12-16 08:58:14 +00:00
Brian Pane
7d3ffc3ee3 Removed the comment suggesting the use of apr_table_overlap()
in add_include_vars() (because I just tried it, and it made the
function slower)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92495 13f79535-47bb-0310-9956-ffa450edef68
2001-12-16 08:50:30 +00:00
Brian Pane
0bb8e72743 Fixed the logic for detecting sentinel or EOS in send_parsed_content
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92489 13f79535-47bb-0310-9956-ffa450edef68
2001-12-15 03:53:59 +00:00
Brian Pane
4beabd7f46 Fix for segfault that happened upon reaching EOS in an
intermediate SSI parsing state
Submitted by:	Justin Erenkrantz


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92488 13f79535-47bb-0310-9956-ffa450edef68
2001-12-15 03:22:24 +00:00
Brian Pane
8434421dde Switched from heap bucket to pool bucket for SSI echo directive
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92391 13f79535-47bb-0310-9956-ffa450edef68
2001-12-08 03:14:50 +00:00