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

560 Commits

Author SHA1 Message Date
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
Ryan Bloom
9c295f8e68 Add the AddFilter directive. This directive takes a list of filter names
that have been previously registered with the server.  Currently the
directive is only valid inside the config file, but once the Options
directive is tweaked a bit, I would feel more comfortable exposing this
directive to htaccess files.

As a part of making adding this filter, I removed the ctx pointer from the
ap_add_filter prototype.  The problem is that the core is the thing that
is actually inserting the filter into the filter stack, but the core doesn't
know how to allocate memory for each filter.  The solution is to have the
filters themselves be responsible for allocating the ctx memory whenever
it is required.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86220 13f79535-47bb-0310-9956-ffa450edef68
2000-09-13 23:13:20 +00:00
Ken Coar
5d50a3e277 Start introducing the extension-method elements so we're not
bound to hard-coded names and a bitmask.  We still use the
	bitmask for known methods, but we also have an array for
	extension method named.  Wherever we used the M_* constants
	we need to use a routine that knows about the new structure instead.

	This is far from complete, but AFAIK this interim work doesn't
	break anything -- especially the compile.  The rest of the
	work will be added in segments; this is just a checkpoint.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86210 13f79535-47bb-0310-9956-ffa450edef68
2000-09-13 01:58:15 +00:00
Ken Coar
023faddf07 Do a bunch of style-guide fixups (like wrapping Boolean tests
correctly and enblocking singel-statement if()s).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86209 13f79535-47bb-0310-9956-ffa450edef68
2000-09-13 01:36:01 +00:00
Ryan Bloom
9acfd7de2d Ensure that only one EOS bucket is sent down the filter stack. This is
done by adding a flag to the request_rec.  When ap_pass_bucket sees an
EOS bucket, the flag is set.  If the flag is still unset when
ap_finalize_request is called, then ap_finalize_request sends an EOS.  This
fixes the problem with chunking and CGI.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86202 13f79535-47bb-0310-9956-ffa450edef68
2000-09-12 03:40:15 +00:00
Tony Finch
7ac6ab9f51 Use wrapper macros to avoid the verbosity of the AP_RING macros when
doing things with bucket brigades.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86185 13f79535-47bb-0310-9956-ffa450edef68
2000-09-09 06:48:10 +00:00
Tony Finch
6d7be19c90 Reduce the manualarity of managing bucket brigade lists by using the
new AP_RING macros. Most of this commit is fairly pedestrian as you
would expect, but I had to redo the chunking filter because of the
amount of pointer juggling it did. I have done some minimal testing
of this patch and it seems to work.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86178 13f79535-47bb-0310-9956-ffa450edef68
2000-09-08 10:16:14 +00:00
Greg Stein
a1d3d62fc6 reversing the latest commit; it was vetoed a while back.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86162 13f79535-47bb-0310-9956-ffa450edef68
2000-08-30 01:09:09 +00:00
Ryan Bloom
eab77d60ac Modify the way filters are added to the server. Instead of using a FIFO,
we use a modified LIFO.  It is modified, because if we add a filter while
in the middle of another filter, the added filter gets put in after the
current filter.  This requires that the server is smart about which filters
are added when.  This should be handled by the HTTP protocol, but we will
want to keep and eye on things for a little while.

This change is necessary, because currently when we add a filter it goes
after the last filter of the same type.  This is broken whenever we want
to add a filter that has a dependancy.  Think about the core and chunking
filters.  They are of the same type, and core is always added first.  When
we go to insert chunking, it gets added, but it is never called.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86161 13f79535-47bb-0310-9956-ffa450edef68
2000-08-29 22:16:45 +00:00
Jeff Trawick
f357ceef76 Filters (and thus ap_pass_brigade()) now return an apr_status_t as their
return value.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86160 13f79535-47bb-0310-9956-ffa450edef68
2000-08-29 20:57:29 +00:00
Ryan Bloom
ae7cca1bd9 Remove IOLs from Apache. They are no longer necessary, now that we have
filtering beginning to work.  There is a hack that has been repeated
through this patch, we morph a pipe into a socket, and put the socket
into the BUFF.  Everytime we do that, we are working with a pipe from
a CGI, and we should be creating a pipe bucket and passing that bucket
back.  Because we don't actually have pipe buckets yet, we are using this
hack.  When we get pipe buckets, this will be fixed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86136 13f79535-47bb-0310-9956-ffa450edef68
2000-08-23 00:01:58 +00:00
Jeff Trawick
87f6dead16 Fix charset translation breakage on EBCDIC machines... the core turned
on buff's translation by default, but mod_charset_lite (when configured
to do so) turned on its own filter-based translation, resulting in
gibberish.

To be determined... whether or not mod_charset_lite should enable
translation of text objects by default (a la 1.3)...  probably... for
now you have to tell mod_charset_lite to translate.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86135 13f79535-47bb-0310-9956-ffa450edef68
2000-08-22 18:01:47 +00:00
Tony Finch
e577544881 Add generic support for reference-counting the resources used by
buckets, and alter the HEAP and MMAP buckets to use it. Change
the way buckets are initialised to support changing the type of
buckets in place, and use it when setting aside TRANSIENT buckets.
Change the implementation of TRANSIENT buckets so that it can be
mostly shared with IMMORTAL buckets, which are now implemented.

Reviewed by:	rbb


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86115 13f79535-47bb-0310-9956-ffa450edef68
2000-08-19 06:04:57 +00:00
Jeff Trawick
dfee69c79b Fix type of bytes_sent parm passed to ap_bucket_mmap_create().
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86106 13f79535-47bb-0310-9956-ffa450edef68
2000-08-18 18:48:11 +00:00
Ryan Bloom
032972c119 A first pass at the chunking filter. This is incredibly simple. As
bucket brigades are sent to this filter, it inserts the chunking header
at the front of the brigade.  When the filter sees an EOS bucket, it
adds the 0 chunking trailer.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86090 13f79535-47bb-0310-9956-ffa450edef68
2000-08-17 00:54:03 +00:00