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

524 Commits

Author SHA1 Message Date
William A. Rowe Jr
d6490633eb Renamed all MODULE_EXPORT symbols to AP_MODULE_DECLARE and all symbols
for CORE_EXPORT to AP_CORE_DECLARE (namespace protecting the wrapper)
  and retitled API_EXPORT as AP_DECLARE and APR_EXPORT as APR_DECLARE.
  All _VAR_ flavors changes to _DATA to be absolutely clear.
  Thank you Greg, for the most obvious suggestion.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86609 13f79535-47bb-0310-9956-ffa450edef68
2000-10-16 06:05:15 +00:00
Ryan Bloom
b73fb78446 Stop using the index into the array for the bucket type. Now we just use
a pointer to a static structure.  The ap_foo_type functions have also been
replaced with simple macro calls.  I am going to replace the
ap_bucket_(read|split|setaside|destroy) functions with macros soon.
Reviewed by:	Will Rowe


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86597 13f79535-47bb-0310-9956-ffa450edef68
2000-10-15 18:15:13 +00:00
Ryan Bloom
f6a723080f Cleanup ap_get_client_block a bit. All of the code that I am removing
doesn't actually do anything useful, it was meant to remove all zero
length buckets before trying to read from the brigade.  However, it is
perfectly fine to not do this, and to just read those buckets along with
the rest of them.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86589 13f79535-47bb-0310-9956-ffa450edef68
2000-10-14 06:53:02 +00:00
Ryan Bloom
1486d62e7e My last patch had most of the code to insert the eos bucket, but it was
missing some major pieces that I only found after the commit.  This patch
fixes the problem, and makes sure that request bodies are always ended
with an EOS bucket.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86588 13f79535-47bb-0310-9956-ffa450edef68
2000-10-14 06:21:38 +00:00
Ryan Bloom
15fe310d97 Get non-chunked input body filtering working with an EOS bucket. The
basic design has ap_setup_client_block setting a field in the conn_rec
which tells http_filter how much data is in the body (with chunking this
will represent how much data is in the chunk).  The ap_get_client_block
then calls down the stack with the maximum amount of data that it can
receive back.  When http_filter reads all of the data, it adds an eos
bucket to the end of the brigade.  ap_get_client_block continues to read
data until it gets the eos bucket.  This allows filters to increase the
size of the body data.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86586 13f79535-47bb-0310-9956-ffa450edef68
2000-10-14 04:37:22 +00:00
Jeff Trawick
26db2ffb0c Introduce ap_debug_assert() macro, like ap_assert() but only active if
AP_DEBUG is defined.

ap_get_client_block():
. avoid some cases where we leak a temporary bucket brigade
. clean up/fix the logic to copy a brigade into the caller's buffer;
  the wrong length was used in some cases
. add an AP_DEBUG-only assertion for some assumptions made regarding
  the brigade returned by the filters

Submitted by:	partly by Greg Stein, but of course anything bad is mine


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86583 13f79535-47bb-0310-9956-ffa450edef68
2000-10-13 18:39:18 +00:00
Jeff Trawick
ee1ba0a23f getline() fixes...
If ap_get_brigade() returns APR_SUCCESS but an empty brigade, bail out.
Previously, we kept going and sometimes segfaulted while operating on
what we thought was the first bucket.

Free the temporary brigade used by getline().


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86581 13f79535-47bb-0310-9956-ffa450edef68
2000-10-13 17:54:24 +00:00
Ryan Bloom
745e689f7c Remove all function pointers from the ap_bucket type. These function
pointers are replaced with a global table that allows modules to register
their bucket types.  Those bucket types are then allowed to be used in
the server processing.  This also required removing all direct calls to
those functions.  The ap_bucket type has an index into an array, so in
each ap_bucket_* function, we use that index to find the correct set of
functions.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86575 13f79535-47bb-0310-9956-ffa450edef68
2000-10-13 05:35:57 +00:00
Jeff Trawick
2761c91ac9 Fix a couple of problems related to large request bodies:
http_filter() - this was referencing e->length even though e->length
    is sometimes -1 (if we have to read the socket bucket to get the
    next bit of the request body); now it does e->read() to force a
    socket need if required
  ap_get_client_block() - this was getting a brigade back with the
    desired amount of data (yeah, right) but only copying out the first
    bucket


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86573 13f79535-47bb-0310-9956-ffa450edef68
2000-10-13 03:12:54 +00:00
Greg Ames
44d920dbfc Make http_filter go a little faster. Remove unused #define.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86570 13f79535-47bb-0310-9956-ffa450edef68
2000-10-12 19:30:11 +00:00
Ryan Bloom
c27033df76 Implement a length argument on input filters. There are three possible
values for the length, -1, 0, and a positive number.  -1 means that the
next filter should return all the data it has, the current filter will
take care to ensure that the protocol is followed.  Most filters will
never use this, because it implies they are implementing a conn_based
input filter.  0 means give me exactly one line of data.  A positive
number means give me a maximum of n bytes.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86567 13f79535-47bb-0310-9956-ffa450edef68
2000-10-12 16:35:39 +00:00
Ryan Bloom
3aed2aae16 A small cleanup for ap_get_client_block.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86561 13f79535-47bb-0310-9956-ffa450edef68
2000-10-12 05:40:46 +00:00
Ryan Bloom
08be79365b We never actually store anything in input_data (from the conn_rec), so it
doesn't make much sense to check to see if there is something there.  This
removes the input_data brigade from the conn_rec altogether.  There is no
good reason for a filter to be accessing a bucket brigade from within the
conn_rec.  This shouldn't be here anymore, just like the output_filter
shouldn't be storing the data in the conn_rec.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86560 13f79535-47bb-0310-9956-ffa450edef68
2000-10-12 04:47:21 +00:00
Ryan Bloom
b9b414f073 This is pretty much the wrong solution, but at least it makes POSTs work
again.  Chunking input doesn't work with this change, but that is because
this is a stop-gap to get POSTs working again.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86555 13f79535-47bb-0310-9956-ffa450edef68
2000-10-12 03:57:45 +00:00
Jeff Trawick
ff2371a56c In read_request_line(), we don't have to check any sort of EOF flag
anymore because getline() returns < 0 upon EOF.
There are also a few very minor tweaks to getline() -- remove an
unused variable, remove a couple of unnecessary comments, simplify
an error path.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86553 13f79535-47bb-0310-9956-ffa450edef68
2000-10-12 02:54:38 +00:00
Greg Ames
1c066ac5ef Clean up input filtering & getline() some more. Character mode telnet now
works for me, but please beat it up and review.

Submitted by: Jeff Trawick, Greg Ames


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86552 13f79535-47bb-0310-9956-ffa450edef68
2000-10-12 01:59:09 +00:00
Ryan Bloom
32165995c1 Clean up the input filtering a lot. This makes the code a bit easier
to follow.  This code works for browser based requests and line-based
telnet requests.  It is untested with character-based telnet requests.
I will be testing that very soon.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86549 13f79535-47bb-0310-9956-ffa450edef68
2000-10-11 23:27:03 +00:00
Ryan Bloom
3c11b9990c Cleanup the input filtering a bit. This does not work with telnet
currently, but it is a step in the right direction.  Input filtering
should be slowly improving from here on out.
Submitted by:	Greg Ames, Ryan Bloom, Jeff Trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86547 13f79535-47bb-0310-9956-ffa450edef68
2000-10-11 18:32:19 +00:00
Jeff Trawick
e512e00ab5 In getline() and ap_get_client_block(), use ap_bucket_destroy()
instead of bucket->destroy().  bucket->destroy() wasn't being
called correctly and also we were leaking the storage for the
bucket itself since bucket->destroy() doesn't free the ap_bucket.
Submitted by:	Ryan Bloom, Jeff Trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86544 13f79535-47bb-0310-9956-ffa450edef68
2000-10-11 17:37:22 +00:00
Jeff Trawick
bead96c345 minor cleanups in http_filter() and ap_get_client_block()
this is not the change to allow us to read broken-up header lines again :(

. http_filter()
  - respect apr_status_t as set by bucket->read() or ap_get_brigade()
  - return apr_status_t instead of length
. ap_get_client_block()
  - remove a confusing line which set the length parameter before
  - passing it to bucket->read()


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86517 13f79535-47bb-0310-9956-ffa450edef68
2000-10-10 17:04:19 +00:00
Ryan Bloom
4b7bc4b099 Fix some types in the latest tree, so that AIX builds cleanly again.
Submitted by:   Victor J. Orlikowski <v.j.orlikowski@gte.net>
Reviewed by:    Ryan Bloom


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86484 13f79535-47bb-0310-9956-ffa450edef68
2000-10-09 19:03:27 +00:00
Ryan Bloom
e1d024d575 No need for the if statement here.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86458 13f79535-47bb-0310-9956-ffa450edef68
2000-10-08 23:22:35 +00:00
Ryan Bloom
68115db561 Clean up the test for \0 in getline.
Submitted by:	Will Wrowe


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86456 13f79535-47bb-0310-9956-ffa450edef68
2000-10-08 16:06:57 +00:00
William A. Rowe Jr
f63d97f8cd That's all I wrote... except for the mpm_winnt.c canonical error patch,
my development tree is up-to-date.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86451 13f79535-47bb-0310-9956-ffa450edef68
2000-10-08 06:08:58 +00:00
Brian Havard
a50e06a708 Fix handling of LF only terminated header lines by not assuming the LF
character will be followed by a 0.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86444 13f79535-47bb-0310-9956-ffa450edef68
2000-10-08 04:25:11 +00:00
Ryan Bloom
27c7ee72ff Remove ap_send_fb and ap_send_fb_length. These functions don't make much
sense anymore, because the BUFFs that Apache used to use it for have all
been replaced with buckets.  BUFFs can't be used with filters, and Apache
doesn't use these functions anywhere anymore, so they need to go away now.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86439 13f79535-47bb-0310-9956-ffa450edef68
2000-10-08 00:55:46 +00:00
Ryan Bloom
bf4966e64c The newest incarnation of http_filter. This is far from perfect, but it
is a step in the right direction.  The idea is that the http_filter knows
about the http protocol.  So, it uses that knowledge to discover HTTP
request headers, and sends those headers up to getline.  However, it keeps
the request body saved in it's ctx pointer.

Later, when ap_get_client_block is called, we have set the remaining field
in the conn_rec.  This tells the http_filter how much of the remaining
data is request body, and how much isn't.  So, the http_filter can return
the request body unparsed up throught ap_get_client_block.

This doesn't even try to work with chunked input data, and there are still
some other bugs in it, but it works for small-ish files in my tests, and
it lets other people play with the concept of input filters.  I will try
to play with this more, but others should feel free to hack around in it
too.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86426 13f79535-47bb-0310-9956-ffa450edef68
2000-10-07 05:41:59 +00:00
Ryan Bloom
283760d18b Fix a potential memory overrun error in ap_get_client_block. The problem
is that the bucket code does not respect the length passed into it.  This
is correct for buckets, but it means that when we get data out of the
buckets, we may have to split the bucket to make sure that any copy
operations are safe.  We were originally doing the split at the number of
characters read from the bucket, but we really want to do it at the length
of the buffer.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86415 13f79535-47bb-0310-9956-ffa450edef68
2000-10-06 16:41:30 +00:00
Ryan Bloom
bb8525b09d Add the first draft of the http_filter. In time this filter will split
the bucket brigade between the headers and the body.  Right now it just
converts \r\n to \n\0.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86412 13f79535-47bb-0310-9956-ffa450edef68
2000-10-06 06:07:07 +00:00
Ryan Bloom
1999084b36 Modify ap_get_client_block to use the bucket brigades instead of BUFF.
I'm pretty sure this isn't complete, but it has worked in my tests with
a very simple CGI.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86410 13f79535-47bb-0310-9956-ffa450edef68
2000-10-05 22:40:28 +00:00
William A. Rowe Jr
01f4c4f960 The lots of little ones... APR_IS_STATUS_condition(rv) conditional macros
replacing the majority of fallible rv == APR_condition tests.  But there
  are lots more to fix, these are the obvious ones that already did proper
  canonical error conversion.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86405 13f79535-47bb-0310-9956-ffa450edef68
2000-10-05 17:33:14 +00:00
Jeff Trawick
b7d765272e Add a bit of infrastructure which will be needed for input filtering:
1) separate filter lists hanging off the r and the c

   requests start off with the same filter list as the connection

   the input filter list is not initialized for subrequests

   internal redirects start off with the same filter list as the
   connection

2) AddInputFilter directive (blatant rip-off of Ryan's AddOutputFilter
   directive); as with AddOutputFilter, the network is implicitly to the
   right of the specified filter list; this may not be the most
   intuitive way to specify the filters; not sure yet


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86403 13f79535-47bb-0310-9956-ffa450edef68
2000-10-05 16:55:10 +00:00
Bill Stoddard
27808c64da Disable the buffer_filter because it may be masking bugs in the bucket brigade
code.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86402 13f79535-47bb-0310-9956-ffa450edef68
2000-10-05 14:00:59 +00:00
Jeff Trawick
a9a0b56629 Now that we have ap_add_input_filter(), rename ap_add_filter() to
ap_add_output_filter().


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86401 13f79535-47bb-0310-9956-ffa450edef68
2000-10-05 12:01:48 +00:00
Jeff Trawick
bf7aaebda6 Get rid of much of the old implementation of translating the
charset of response bodies.

ap_checkconv() is removed, except for in os/bs2000 and os/tpf.
(Anything there is questionable for 2.0 anyway.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86400 13f79535-47bb-0310-9956-ffa450edef68
2000-10-05 11:21:26 +00:00
Greg Ames
327d811b3d Fix a bug where a client which only sends \n to delimit header
lines (netcat) gets a strange looking HTTP_NOT_IMPLEMENTED message.

While I'm in there, start working on ebcdic co-existance with input
filtering.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86397 13f79535-47bb-0310-9956-ffa450edef68
2000-10-05 03:55:12 +00:00
Ryan Bloom
8b56ba850a Connection oriented filters are now stored in the conn_rec instead of the
request_rec.  This means that a conn_rec must be supplied when calling
ap_add_filter.  The reason for this change is that we need to be able to
add the core_filter (whether or SSL or not) before we try to read the
request.  This way, if a request fails, we can actually send the error
page back to the client.  With this change, we add the core filter to the
conn_rec during the pre-connection phase.
Submitted by:	Ryan Bloom, Jeff Trawick, and Greg Ames


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86392 13f79535-47bb-0310-9956-ffa450edef68
2000-10-04 23:19:33 +00:00
Ryan Bloom
baa50d0a2d Back out a patch that should never have been committed
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86388 13f79535-47bb-0310-9956-ffa450edef68
2000-10-04 19:08:34 +00:00
Ryan Bloom
006d343a71 Fix a small typo that was keeping us from copying os-inline.c to the
include directory


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86387 13f79535-47bb-0310-9956-ffa450edef68
2000-10-04 19:00:36 +00:00
Jeff Trawick
3d4873b9f0 Change ap_send_fd() so that it returns a proper apr_status_t value
instead of the number of bytes sent.

default_handler() ignores the ap_send_fd() return code, but
mod_file_cache doesn't.  When mod_file_cache's handler called
ap_send_fd(), the client would get the desired file plus an
error document (500 internal server error), which was delivered
because mod_file_cache's handler returned an error since
ap_send_fd() returned non-zero.

Also in this commit is a hack to be able to compile when APACHE_XLATE
is defined.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86380 13f79535-47bb-0310-9956-ffa450edef68
2000-10-03 22:08:38 +00:00
Ryan Bloom
7ae2f294fd Implement input filtering. This is definately not completely correct, but
it is a good first step.  It is possible to add filters when reading from
the client with this change.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86359 13f79535-47bb-0310-9956-ffa450edef68
2000-10-02 00:47:28 +00:00
Bill Stoddard
bddddae4a1 First cut at a filter to buffer/coalesce multiple small buckets into a single large bucket.
This implementation is limited to coalescing a single string of small (< MIN_BUCKET_SIZE)
buckets into one large bucket.  If a brigade contains a string of small buckets followed by a
large bucket followed by another string of small buckets, only the first string will be coalesced.

This implementation works very well with the output generated by mod_autoindex though.
The number of iovecs handled by http_core is reduced to three from over a thousand for my
test case.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86355 13f79535-47bb-0310-9956-ffa450edef68
2000-09-29 18:12:14 +00:00
Greg Ames
d5254724ba Create a helper function "get_canned_error_string" for use by
ap_send_error_response.  The new function simply returns the error response
string corresponding to given HTTP error core.  This makes it easier to
change the mechanism for sending these strings, because we no longer have
r[v]puts calls spread throughout the error string generation code.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86341 13f79535-47bb-0310-9956-ffa450edef68
2000-09-26 23:01:55 +00:00
Ryan Bloom
d1a8073aa8 Combine the calls to add the core_filter to one place. Basically, it is
safe to add the core_filter during the post_read_request, and it means
that we only have to add the filter once in the code.  This should make
it easier to add an SSL module in the future.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86307 13f79535-47bb-0310-9956-ffa450edef68
2000-09-23 18:39:30 +00:00
Bill Stoddard
9115d6301c First cut at a file bucket. Modify the core_filter to handle use
of apr_sendfile(). Modify ap_send_fd() to use the new file bucket.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86278 13f79535-47bb-0310-9956-ffa450edef68
2000-09-21 16:22:13 +00:00
Greg Ames
c0f7a5b2c8 Fix a bug where errors that happen during early request parsing (like 400
HTTP_BAD_REQUEST) don't send any error message content to the browser.
The core_filter wasn't present this early in request parsing, so the output
went into the bit bucket via r[v]puts->ap_pass_brigade.

The chunking filter takes care of itself nicely, because it is added in
ap_send_http_header if it's needed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86253 13f79535-47bb-0310-9956-ffa450edef68
2000-09-19 21:11:01 +00:00
Jeff Trawick
b528a5f825 Fix the calling convention on Windows for ap_bucket_printf() and
ap_method_list_do().


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86249 13f79535-47bb-0310-9956-ffa450edef68
2000-09-18 19:30:23 +00:00
Ryan Bloom
29e68ae602 Change r->filters to r->output_filters. This sets things up for us to
put input filters into Apache.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86246 13f79535-47bb-0310-9956-ffa450edef68
2000-09-18 01:24:55 +00:00
Jeff Trawick
6f6e4b504c Get rid of some unused variables introduced in recent method work.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86231 13f79535-47bb-0310-9956-ffa450edef68
2000-09-14 20:43:14 +00:00
Doug MacEachern
dad154a2ca put ctx back in ap_add_filter()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86224 13f79535-47bb-0310-9956-ffa450edef68
2000-09-14 05:08:42 +00:00