1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-08 15:02:10 +03:00

383 Commits

Author SHA1 Message Date
Ryan Bloom
4b173d707a The headers need to be at the end of the request_based filters.
Submitted by:	Jon Travis <jtravis@covalent.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86703 13f79535-47bb-0310-9956-ffa450edef68
2000-10-22 15:26:05 +00:00
Jeff Trawick
807983f2e7 namespace-protect dechunk_filter and http_filter
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86699 13f79535-47bb-0310-9956-ffa450edef68
2000-10-22 13:09:23 +00:00
Ryan Bloom
9fbdac023f Hack headers to work semi-properly. This is a hack that will need to be
fixed, but it is good enough for now.  The idea is that headers shouldn't
flow through the BUFF anymore.  Now, we have a header filter that is
called at the end of the request-filter chain.  This filter writes the
headers directly to the connection filters.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86687 13f79535-47bb-0310-9956-ffa450edef68
2000-10-21 14:20:14 +00:00
Jeff Trawick
96cf82e63b Input filters and ap_get_brigade() now have a input mode parameter
(blocking, non-blocking, peek) instead of a length parameter.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86684 13f79535-47bb-0310-9956-ffa450edef68
2000-10-21 13:20:36 +00:00
Bill Stoddard
bf1eb0532d Rename buffer_filter to coalesce_filter.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86683 13f79535-47bb-0310-9956-ffa450edef68
2000-10-21 12:38:17 +00:00
Ryan Bloom
140586d14f Namespace protect the rest of the macros defined by ap_config.h
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86661 13f79535-47bb-0310-9956-ffa450edef68
2000-10-19 00:05:00 +00:00
Ryan Bloom
0dbda593ad Make the core access the socket directly instead of going through the
BUFF.  This doesn't actually change any behavior, it just makes the core
access socket directly.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86652 13f79535-47bb-0310-9956-ffa450edef68
2000-10-18 19:32:30 +00:00
Ryan Bloom
2e8c484fd4 Use pool buckets where appropriate. The places I have found so far, are
the buffer_filter, and where the core_filter gets data from the BUFF.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86635 13f79535-47bb-0310-9956-ffa450edef68
2000-10-17 22:34:14 +00:00
Jeff Trawick
ce0a65bfd6 Rename output filters field ("filters") in core_dir_config to
"output_filters" for consistency with the name of the input
filters field ("input_filters").


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86623 13f79535-47bb-0310-9956-ffa450edef68
2000-10-17 01:35:12 +00:00
Ryan Bloom
86a1ecbda0 Add a flush bucket type. This bucket advises filters to flush any data
they are currently storing.  There is no way we can force them to flush,
but we can advise.  This also adds the code to ap_rflush to use flush
buckets, although it isn't enabled yet.  I will enable it once we remove
buff from the code.  I also removed all calls to ap_rflush that are either
immediately before or immediately after a call to ap_finalize_protocol.
ap_finalize_protocol sends an EOS bucket, which also advises filters to
flush their data, so having both calls right next to each other is
redundant.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86619 13f79535-47bb-0310-9956-ffa450edef68
2000-10-17 00:24:36 +00:00
Ryan Bloom
25535f86ec Add a sub-request filter. This filter just strips the EOS from the
brigade generated by the sub-request.  If this is not done, then the
main-request's core_output_filter will get very confused, as will any other
filter in the main-request filter-stack that looks for EOS.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86618 13f79535-47bb-0310-9956-ffa450edef68
2000-10-16 23:15:55 +00:00
Jeff Trawick
eb7793f871 input filtering changes:
get dechunking working
  verify that infrastructure for input filters works
    (use existing AddInputFilter directive)

Unlike with my previous patch, ap_get_client_block() saves state between
calls in the core's per-request dir config.

Unlike with my previous patch, HTTP_IN keeps a count of remaining bytes
in the conn_rec.  Code that needs to prod it to deliver a certain amount
of request body plays with conn_rec->remain directly.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86613 13f79535-47bb-0310-9956-ffa450edef68
2000-10-16 19:11:53 +00:00
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
David Reid
a737624245 Tidy up some types.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86602 13f79535-47bb-0310-9956-ffa450edef68
2000-10-15 22:42:59 +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
f5ab7f6f10 Add a #else back into http_core.c, so that this compiles on Unix again.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86580 13f79535-47bb-0310-9956-ffa450edef68
2000-10-13 17:36:51 +00:00
William A. Rowe Jr
a286d71463 Completes the port of the <Directory /> handling for Win32... there is
still a patch needed for OS2 ... Brian?


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86579 13f79535-47bb-0310-9956-ffa450edef68
2000-10-13 16:57:21 +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
Ryan Bloom
9a12345722 Remove the offset field from ap_bucket type. This is a file bucket
specific value, and therefore it belongs in the ap_bucket_file type,
which was also created with this commit.  ap_bucket needs to be as generic
as possible to make it easily extensible, which means we have to keep
the generic ap_bucket type very separate from ap_bucket_foo.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86568 13f79535-47bb-0310-9956-ffa450edef68
2000-10-12 18:01:30 +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
Jeff Trawick
494d2b064f Get rid of some compile warnings on systems with no sendfile and/or lack of
one or more rlimit controls.  (Solaris 2.8 hits both of these.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86554 13f79535-47bb-0310-9956-ffa450edef68
2000-10-12 03:17:36 +00:00
Jeff Trawick
4e2d08016b Avoid swap-til-you-drop by cutting off a loop once the client closes.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86551 13f79535-47bb-0310-9956-ffa450edef68
2000-10-12 01:50:51 +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
Ryan Bloom
af3351bb19 Back out the change to move the core_output_filters brigade to the
conn_rec.  Since all requests on a given connection use the same
core_output_filter, the ctx in that filter has the correct lifetime


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86494 13f79535-47bb-0310-9956-ffa450edef68
2000-10-10 03:35:11 +00:00
Jeff Trawick
142f72090c rename core_register_filter() to core_insert_filter()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86491 13f79535-47bb-0310-9956-ffa450edef68
2000-10-10 02:14:11 +00:00
Jeff Trawick
9e5bc087a1 core_input_filter():
remove old code which looked for LF
  return apr_status_t value instead of length


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86490 13f79535-47bb-0310-9956-ffa450edef68
2000-10-10 02:10:42 +00:00
Ryan Bloom
5e891204a4 Remove an annoying warning.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86487 13f79535-47bb-0310-9956-ffa450edef68
2000-10-09 23:11:21 +00:00
Bill Stoddard
89c398aa0c Fix another bug in the send_the_file() read/write loop. A partial
send by apr_send would cause unsent data in the read buffer to
 get clobbered. Complete making send_the_file handle partial
 writes to the network.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86485 13f79535-47bb-0310-9956-ffa450edef68
2000-10-09 22:08:49 +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
Bill Stoddard
818f94113f Initialize nbytes across each iteration and not just after a call to writev_it_all.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86479 13f79535-47bb-0310-9956-ffa450edef68
2000-10-09 18:02:45 +00:00
Bill Stoddard
c184561fb3 Fix bug which would cause offset to be ignored in send_the_file() if there were
no headers to send.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86477 13f79535-47bb-0310-9956-ffa450edef68
2000-10-09 16:35:20 +00:00
Bill Stoddard
3e5333488f Handle receiving APR_ENOTIMPL from apr_sendfile. This is mainly to accomodate
Windows 95/98 with binaries compiled on Windows NT.  The solution is not specific
toWindows though.  Catch up on some CHANGES logging.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86476 13f79535-47bb-0310-9956-ffa450edef68
2000-10-09 16:33:24 +00:00
Ryan Bloom
d07a6058a1 Fix the char-at-a-time problem. To fix this, we just buffer up a line
until we have found a LF, then we send the data up to the previous filter.
I have test on Linux with both Linux's telnet and Win 98 telnet.  Win98
uses a char-at-a-time, so this should solve the problem.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86457 13f79535-47bb-0310-9956-ffa450edef68
2000-10-08 19:03:18 +00:00
Ryan Bloom
a9e2a3673b Update send_the_file to fall back to a read/write loop on platforms
without sendfile.  This also makes the apr_hdtr_t type available on
all platforms, regardless of whether apr_sendfile is defined or not.
Submitted by:	Brian Havard and Ryan Bloom


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86437 13f79535-47bb-0310-9956-ffa450edef68
2000-10-07 21:54:16 +00:00
Ryan Bloom
360f36a96b The core filter should not be using its own brigade inside its own ctx
structure.  This changes the core_output_filter to use a brigade inside
the conn_rec.  Think of this as analagous to the BUFF in the conn_rec.
The idea is that if we have pipelined requests, and it isn't worth it to
send the last bit of data from the first request, we want to save that
extra bit of data to the conn_rec, so that the next request sends it
automatically.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86433 13f79535-47bb-0310-9956-ffa450edef68
2000-10-07 18:10:02 +00:00
Jim Jagielski
3933b6d72f This is ugly, but at least we compile again on platforms that lack
sendfile().
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86423 13f79535-47bb-0310-9956-ffa450edef68
2000-10-07 00:37:18 +00:00
William A. Rowe Jr
cbd58ab0bd Here it is, the Win32 part of the big canonical errors patch.
The reason is really, really simple.  If we ever choose to mix clib and
  dos error codes, they criss-cross and don't line up, but they share the
  same number space.  As I wrote the new APR_IS_ERROR macros, I realized
  we were about to shoot ourselves in the foot.

  These changes nearly entirely affect Win32 only.  The next big patch will
  affect all of the rv == APR_ENOENT type problems throughout the system.

PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86416 13f79535-47bb-0310-9956-ffa450edef68
2000-10-06 17:24:43 +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
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
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
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
Jeff Trawick
73be8aa199 In core_output_filter(), reset nbytes to zero after calling
writev_it_all() in case we have another brigade to process.
Otherwise, nbytes is bogus for the second brigade and
writev_it_all() doesn't know when to quit (it loops).

In writev_it_all(), when compensating for bytes already sent
don't go beyond the number of iovs we were passed on input.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86391 13f79535-47bb-0310-9956-ffa450edef68
2000-10-04 22:09:46 +00:00
Bill Stoddard
f1a7b0d209 Take another shot at reimplementing core_output_filter. This implementation buffers
brigades across multiple calls until MAX_IOVEC_TO_WRITE or
MIN_SIZE_TO_WRITE thresholds are hit. This implementation does not attempt
to coalesce bytes. Moving a bit further down the filter learning curve...


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86389 13f79535-47bb-0310-9956-ffa450edef68
2000-10-04 19:11:03 +00:00
Jeff Trawick
eed0345ff6 Clean up md5 digest support in default_handler() a bit:
1) don't compute md5 if we have a content filter; it is almost always wrong
2) add note about adding md5 filter in the future; this can be done
3) delete some APACHE_XLATE/CHARSET_EBCDIC baggage associated with md5
   digest support; part of this deleted baggage is a segfault on
   subrequests referencing r->rrx (which is not allocated for subrequests)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86385 13f79535-47bb-0310-9956-ffa450edef68
2000-10-04 17:14:00 +00:00
Jeff Trawick
d0c344bafa Change core_input_filter() so that it returns an empty brigade upon
FIN/EOF or error.  This meshes with what getline() looks for.  It isn't
perfect, but it avoids some nasty loops consuming all available storage
on http/1.1 connections.  In keepalive state, we call getline to read the
next request...  getline() calls core_input_filter() (indirectly)...
core_input_filter() calls apr_recv() which returns APR_SUCCESS/0 bytes
to signal FIN/EOF.  But core_input_filter() returned a bucket with length
zero to getline(), so getline() called core_input_filter() again.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86379 13f79535-47bb-0310-9956-ffa450edef68
2000-10-03 21:56:43 +00:00
Ryan Bloom
ba047efee0 Move where the CORE_IN filter is added to the server. We used to do this
in ap_new_connection, but that is bogus, because then other modules can't
put their own filter in.  Now, we do this in a new pre-connection hook
function.  Later, we will want to add some checking to make sure that this
is really an HTTP request that we are adding the filter for.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86364 13f79535-47bb-0310-9956-ffa450edef68
2000-10-02 19:52:37 +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
Jeff Trawick
22f4f4488f Fix the lifetime of the autodata buffer used for the chunk header.
Submitted by:	Bill Stoddard
Reviewed by:	Jeff Trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86352 13f79535-47bb-0310-9956-ffa450edef68
2000-09-28 22:57:17 +00:00
Bill Stoddard
3a1e7ab1cb Fix compile break. It should be apr_pstrcat.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86317 13f79535-47bb-0310-9956-ffa450edef68
2000-09-25 16:42:49 +00:00