1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-06 16:49:32 +03:00
Commit Graph

165 Commits

Author SHA1 Message Date
Cliff Woolley
af9bfbb2b3 "Oops" has two o's in it. :)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94235 13f79535-47bb-0310-9956-ffa450edef68
2002-03-27 21:16:37 +00:00
Doug MacEachern
5bfe936911 3rd arg of BIO callbacks in 'const char' in OpenSSL and 'char' in sslc,
make both happy.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94198 13f79535-47bb-0310-9956-ffa450edef68
2002-03-27 01:58:15 +00:00
Doug MacEachern
22c5fe3f27 OpenSSL uses void * for callback data, sslc uses char *,
cast to void * to make both happy.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94197 13f79535-47bb-0310-9956-ffa450edef68
2002-03-27 01:50:43 +00:00
Doug MacEachern
dd679accdf correct comment in previous change
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94171 13f79535-47bb-0310-9956-ffa450edef68
2002-03-26 00:49:37 +00:00
Doug MacEachern
dc0b193480 PR:
Obtained from:
Submitted by:
Reviewed by:
fix bug seen on win32 with netscape client where output filter is run
triggered by lingering_close after ssl_hook_CloseConnection has been called


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94170 13f79535-47bb-0310-9956-ffa450edef68
2002-03-26 00:30:47 +00:00
Doug MacEachern
9813433685 fix comment
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93932 13f79535-47bb-0310-9956-ffa450edef68
2002-03-14 07:21:10 +00:00
Doug MacEachern
e00ddfd24b PR:
Obtained from:
Submitted by:
Reviewed by:
fix bug in ssl_io_input_getline():
in most cases we get all the headers on the first SSL_read.
however, in certain cases SSL_read will only get a partial
chunk of the headers, so we now try to read until LF is seen.

bug seen with netscape client (running both on linux and win32) and
server running on win32.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93931 13f79535-47bb-0310-9956-ffa450edef68
2002-03-14 07:04:10 +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
Justin Erenkrantz
94d01b65aa Change ap_get_brigade prototype to remove *readbytes in favor of readbytes.
If you need the length, you should be using apr_brigade_length.  This is
much more consistent.  Of all the places that call ap_get_brigade, only
one (ap_http_filter) needs the length.  This makes it now possible to
pass constants down without assigning them to a temporary variable first.

Also:
- Change proxy_ftp to use EXHAUSTIVE mode (didn't catch its -1 before)
- Fix buglet in mod_ssl that would cause it to return too much data in
  some circumstances


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93014 13f79535-47bb-0310-9956-ffa450edef68
2002-01-25 01:11:47 +00:00
Justin Erenkrantz
72e3b21614 - Add AP_MODE_SPECULATIVE support to mod_ssl
- Protect mod_ssl from dealing with modes it doesn't recognize.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92968 13f79535-47bb-0310-9956-ffa450edef68
2002-01-22 06:33:35 +00:00
Justin Erenkrantz
af117f2f16 If we would exhaust the buffer entirely, set it to NULL rather than
point at the end of the buffer with a length of 0.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92967 13f79535-47bb-0310-9956-ffa450edef68
2002-01-22 06:26:07 +00:00
Justin Erenkrantz
7d32242a14 Input filtering prototype change: Socket blocking type should be
separate from the input filter mode type.

We also no longer look at readbytes to determine the method of
filter operation.  This makes the use of filters more obvious and
allows a wider range of options for input filters modes.

To start with, the new input filter modes are:

AP_MODE_READBYTES (no more than *readbytes returned)
AP_MODE_GETLINE (old *readbytes == 0 case)
AP_MODE_EATCRLF (old AP_MODE_PEEK)
AP_MODE_SPECULATIVE (will be used in a future ap_getline rewrite)
AP_MODE_EXHAUSTIVE (old *readbytes == -1 case)
AP_MODE_INIT (special case for NNTP over SSL)

The block parameter is an apr_read_type_e: APR_BLOCK_READ, APR_NONBLOCK_READ

This also allows cleanup of mod_ssl's handling in the getline case.

Reviewed by:	Ryan Bloom (concept), Greg Stein (concept)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92928 13f79535-47bb-0310-9956-ffa450edef68
2002-01-19 07:45:18 +00:00
Doug MacEachern
7a33a9e58d fix for SSLv2 requests
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92897 13f79535-47bb-0310-9956-ffa450edef68
2002-01-18 00:13:25 +00:00
William A. Rowe Jr
b444b9bd83 Clean up several typesaftey (signedness and size) emits.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92889 13f79535-47bb-0310-9956-ffa450edef68
2002-01-17 15:51:41 +00:00
Doug MacEachern
e937a7c48a output filter optimizations:
- avoid creating a new bucket brigade for each EOS or FLUSH bucket
- do not pass FLUSH bucket since BIO_bucket_flush() already does so
  if there is any data to flush.
- do not call apr_brigade_destroy(bb); since we will have either
  emptied it or passed it, in which case it will be destroyed further
  down the chain.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92885 13f79535-47bb-0310-9956-ffa450edef68
2002-01-17 05:04:54 +00:00
Doug MacEachern
ae33d7594f adjust BIO_METHOD initializers for sslc
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92881 13f79535-47bb-0310-9956-ffa450edef68
2002-01-17 01:35:20 +00:00
Doug MacEachern
f2e97102ce rewrite of mod_ssl input filter for better performance and less memory usage
PR:
Obtained from:
Submitted by:
Reviewed by:	Justin Erenkrantz


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92873 13f79535-47bb-0310-9956-ffa450edef68
2002-01-17 00:54:33 +00:00
William A. Rowe Jr
3165fd3e30 Correct case comparison typematch
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92279 13f79535-47bb-0310-9956-ffa450edef68
2001-12-02 01:26:45 +00:00
Doug MacEachern
70d030984c remove churn_output() function and calls to it.
when SSL needs to flush (e.g. during SSL_accept()) it will call BIO_flush()
which will trigger a call to bio_bucket_ctrl() -> BIO_bucket_flush().
so we only need to flush the output ourselves if we receive an EOS or
FLUSH bucket.

BIO_bucket_flush() and churn_output() had been turning up near the top
of the profile with gprof.  churn_output() of course has now vanished
and BIO_bucket_flush() has dropped, being called far less than before.

PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92271 13f79535-47bb-0310-9956-ffa450edef68
2001-12-01 02:11:04 +00:00
Doug MacEachern
d6497301dc moving chunk of logic that deals with writing ssl data from
ssl_io_filter_Output() to a new ssl_filter_write() function.
this will make it easier to optimize how we deal with file buckets
than cannot be mmaped.
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92209 13f79535-47bb-0310-9956-ffa450edef68
2001-11-28 03:15:41 +00:00
Doug MacEachern
83c0b89f0a implement a custom BIO which allows us to hook SSL_write directly into
an apr_bucket_brigade and use transient buckets with the SSL
malloc-ed buffer, rather than copying into a mem BIO.

also allows us to pass the brigade as data is being written
rather than buffering up the entire response in the mem BIO.

PR:
Obtained from:
Submitted by:
Reviewed by:	Justin Erenkrantz, Ryan Bloom


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92206 13f79535-47bb-0310-9956-ffa450edef68
2001-11-27 23:37:20 +00:00
Doug MacEachern
b03492249b add input filter AP_MODE_INIT support to handshake before reading
request data from the client.
PR:
Obtained from:
Submitted by:	dougm
Reviewed by:	wrowe


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92043 13f79535-47bb-0310-9956-ffa450edef68
2001-11-19 22:37:57 +00:00
Ryan Bloom
c443151064 Fix the SSL filter logic. The SSL filter is not a network filter, because
it does not actually do the reading and writing to the network.  By
moving that filter to in between CONNECTION and NETWORK filters, we ensure
that SSL is always called before the core.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91969 13f79535-47bb-0310-9956-ffa450edef68
2001-11-15 20:55:13 +00:00
William A. Rowe Jr
b9e48fc75e Fix a nasty GP fault... stop testing buckets after they are passed!!!
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91610 13f79535-47bb-0310-9956-ffa450edef68
2001-10-20 20:43:37 +00:00
Justin Erenkrantz
f002d4e8fd Well, now I know what the bio_is_renegotiating call was for.
Place a big-ass comment there so that whomever comes next isn't stuck
at a cryptic call that they don't understand with a dinky comment.
Hopefully, this makes sense.  Someone more familiar with OpenSSL should
verify the comment.

This fix also requires the normalize call to be performed before
churn_input so that we don't enter churn_input with a 0-length ctx->b
brigade.

All httpd-test tests (except for the module/negotiation test) pass now.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91442 13f79535-47bb-0310-9956-ffa450edef68
2001-10-12 06:27:04 +00:00
Justin Erenkrantz
4714a72ae4 If we passed the bucket to ap_pass_brigade (because it was EOS or FLUSH),
we shouldn't delete it.

Thanks to Doug for pointing out that something broke.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91441 13f79535-47bb-0310-9956-ffa450edef68
2001-10-12 04:59:19 +00:00
Justin Erenkrantz
fd1950344a Lose the magic number and use the central #define AP_IOBUFSIZE.
Hey, I've never seen it in actual use anywhere, so I didn't know.

Thanks to Roy for pointing it out.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91440 13f79535-47bb-0310-9956-ffa450edef68
2001-10-12 02:00:41 +00:00
Justin Erenkrantz
e3d203298e This is the mod_ssl input filtering rewrite. Lots of stuff here. I also
changed some of the style issues within the filtering code to conform to
the rest of the server.

Various incarnations of this patch have been posted to dev@httpd without
feedback.  Now that it passes all of the httpd-test cases (with the
exception of module/negotiation test which fails without mod_ssl anyway),
it is time to check it in.

Please review and test.  We are under C-T-R rules, so I'm going to take
advantage of that and commit it now.  I have tested this about as much
as I can and it seems to work from everything I can give to it.
Considering that mod_ssl was broken before this commit, this is an
improvement.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91414 13f79535-47bb-0310-9956-ffa450edef68
2001-10-11 01:49:21 +00:00
Justin Erenkrantz
d18a2bcce3 Ah, I didn't see that churn is only used on input - rename the function
to match churn_output.  =)

Yes, I'm slowly working on fixing mod_ssl...


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91289 13f79535-47bb-0310-9956-ffa450edef68
2001-10-04 17:50:39 +00:00
William A. Rowe Jr
92c68926f4 BIO_write returns an int. Whacha gonna do? Kill the last non-ab warning.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91220 13f79535-47bb-0310-9956-ffa450edef68
2001-10-01 16:07:17 +00:00
Ryan Bloom
bfe91354fb Allow mod_ssl to send back an error message if an HTTP request is sent
over an HTTPS connection.  This also adds an ap_remove_input_filter
function, which should be used to remove the SSL input filter in this
case, as soon as this code is stressed a bit more.

For right now, we are sending the same message that we used to send in
mod_ssl for Apache 1.3.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90724 13f79535-47bb-0310-9956-ffa450edef68
2001-08-27 06:00:51 +00:00
Doug MacEachern
99bc864e36 enable i/o debugging
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90645 13f79535-47bb-0310-9956-ffa450edef68
2001-08-24 18:06:47 +00:00
Doug MacEachern
e3f378e265 churn_output should return the value of ap_pass_brigade
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90640 13f79535-47bb-0310-9956-ffa450edef68
2001-08-24 17:17:35 +00:00
Cliff Woolley
051e111a79 performance: change an O(n) while loop to an equivalent O(1) brigade macro
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90536 13f79535-47bb-0310-9956-ffa450edef68
2001-08-23 02:32:26 +00:00
Cliff Woolley
b5bfeab91b Another step in improving legibility by factoring out some redundant code
(how many times can you test the same condition in one function? :-)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90535 13f79535-47bb-0310-9956-ffa450edef68
2001-08-23 02:23:43 +00:00
Cliff Woolley
0797ef8079 Nit: the lack of brackets was driving me crazy
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90531 13f79535-47bb-0310-9956-ffa450edef68
2001-08-23 00:23:54 +00:00
Cliff Woolley
10638bebb4 Simplify the apr_read_type_e vs. ap_input_mode_t silliness. The two
are compatible (due to our early abort when PEEK mode is requested),
so we don't have to go to so much effort to convert from one to the other.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90530 13f79535-47bb-0310-9956-ffa450edef68
2001-08-23 00:21:40 +00:00
Cliff Woolley
6178a2c69e There's only one way for bb to be non-NULL, so these two
cases can be combined.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90513 13f79535-47bb-0310-9956-ffa450edef68
2001-08-22 22:25:14 +00:00
Doug MacEachern
d001e33664 rather than creating small 1024 byte buckets of output data,
create a transient bucket pointing directly to the BIO mem buff.
this makes for a dramatic increase in performance. previously,
downloading large files (2Mb-5Mb-ish) made my laptop start to
smoke from the fan spinning so fast to cool the cpu.
also, apache stylize churn_output()
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90497 13f79535-47bb-0310-9956-ffa450edef68
2001-08-22 16:59:26 +00:00
Doug MacEachern
8354775eec destroy the brigade when we are done with it, rather than remove
one bucket at a time.  prevents a problem when downloading large files.
also change ssl_io_filter_Output to apache style
and change some variable names that should make the code easier to
read/understand, e.g. pbbIn -> bb, pbktIn -> bucket
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90490 13f79535-47bb-0310-9956-ffa450edef68
2001-08-22 15:30:37 +00:00
Doug MacEachern
8eba9b3bac cut out some noise
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90451 13f79535-47bb-0310-9956-ffa450edef68
2001-08-21 00:58:42 +00:00
Doug MacEachern
242a4afd67 get rid of asserts
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90450 13f79535-47bb-0310-9956-ffa450edef68
2001-08-21 00:53:54 +00:00
Doug MacEachern
9d806f444e remove unused #if 0-ed code when reading from the write bio
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90445 13f79535-47bb-0310-9956-ffa450edef68
2001-08-20 23:53:50 +00:00
Doug MacEachern
6c69c6421a remove unused ssl_io_ functions
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90444 13f79535-47bb-0310-9956-ffa450edef68
2001-08-20 23:48:16 +00:00
Jeff Trawick
901dab0572 check for timeout on socket read when we check for ECONNRESET and eof
previously, we'd die on an assert() (really nasty for threaded MPM) when
we hit a keepalive timeout for a browser like netscape which keeps the
connection open


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90244 13f79535-47bb-0310-9956-ffa450edef68
2001-08-16 21:11:30 +00:00
Jeff Trawick
7f6f1a2cdc fix a few mod_ssl warnings for stuff like function which were neither
static nor prototyped, char * vs. const char *, etc.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90238 13f79535-47bb-0310-9956-ffa450edef68
2001-08-16 19:56:47 +00:00
Doug MacEachern
5eb7150217 if ssl shutdown happens earlier than expected, filter code needs be aware
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90227 13f79535-47bb-0310-9956-ffa450edef68
2001-08-16 17:01:53 +00:00
Doug MacEachern
c64021d473 need to remove buckets from the output brigade, since we will be passing a different brigade
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90225 13f79535-47bb-0310-9956-ffa450edef68
2001-08-16 16:46:30 +00:00
Doug MacEachern
d79cea3d70 enable ssl Translate, UserCheck, Access and Auth hooks
add support for renegotiation during the Access hook
this requires hooking into the read and write SSL BIOs in order to
flush data to the client and read from the filter chain

this also requires that the ssl filters become "aware" that
renegotitation is in progress so that the BIOs are left alone for
SSL_renegotiate/SSL_do_handshake in ssl_hook_Access to deal with

PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90185 13f79535-47bb-0310-9956-ffa450edef68
2001-08-16 03:58:16 +00:00
Doug MacEachern
d9ed774c22 need to check return value of ssl_hook_process_connection
if != APR_SUCCESS the ssl connection has been shutdown
(for example client cert was revoked)
PR:
Obtained from:
Submitted by:
Reviewed by:


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