1
0
mirror of https://github.com/apache/httpd.git synced 2025-06-10 18:21:43 +03:00
Commit Graph

147 Commits

Author SHA1 Message Date
79c5523d2f errno? EINTR? what planet was this code on :-? Normalize the
ssl_io_filter_connect code to follow the filter read and write.
  Notice that it's buck ugly, but we will extract an rc first from
  the input BIO if it was written, and then try the output bio if
  it was APR_SUCCESS, during _connect processing.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97422 13f79535-47bb-0310-9956-ffa450edef68
2002-11-06 07:21:47 +00:00
dce6e3383f Merge the last of the 'filtering' functions into ssl_engine_io.c, merge
ssl_abort into what was ssl_hook_CloseConnection, clean out a bunch of
  now-static or private headers from mod_ssl.h, and final fix a very small
  but potent segfault if ->pssl is destroyed within our read loop.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97411 13f79535-47bb-0310-9956-ffa450edef68
2002-11-05 20:47:01 +00:00
fd0031d09f Actually, the APR_ECONNABORTED (EOS-only brigade) is the direction we
are contemplating for the next release, not the prior behavior
  (which was APR_SUCCESS for c->aborted.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97401 13f79535-47bb-0310-9956-ffa450edef68
2002-11-05 06:38:41 +00:00
e615292ccc With a last little bit of help from Justin, this should cause the
appropriate amount of tumolt and turmoil if our client has 'gone away'
  on us, sparing us of further processing (and potential 'renegotiations'
  with a non-existant client.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97400 13f79535-47bb-0310-9956-ffa450edef68
2002-11-05 03:38:14 +00:00
d9203ca5bc At least one doc I've seen says EOF+bytes is valid. This was a typo.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97399 13f79535-47bb-0310-9956-ffa450edef68
2002-11-05 03:16:33 +00:00
2c5b9e7d66 Appears we forgot to check the possibility of errors coming from the
write brigade passed down from the content generator through the body
  and protocol filters.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97397 13f79535-47bb-0310-9956-ffa450edef68
2002-11-04 19:41:52 +00:00
ef70d9e2f7 Rename the many flavors of filter_ctx (pRec, fctx etc) to filter_ctx,
wbio to bio_out, BIO new and free to create and destroy (to match OpenSSL),
  refactor the bio write code to stash errors in outctx->rc,
  fix the blocking read at EOF if we have some data to return,
  and preempt the nonblock read on GETLINE if we have the newline already.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97393 13f79535-47bb-0310-9956-ffa450edef68
2002-11-04 17:39:56 +00:00
f87ec93f2e Add some waypoints to understanding this code
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97374 13f79535-47bb-0310-9956-ffa450edef68
2002-11-01 10:37:06 +00:00
24aa081c2d Add some commentary on how we *think* the input filtering should be working
in mod_ssl.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97373 13f79535-47bb-0310-9956-ffa450edef68
2002-11-01 10:19:56 +00:00
35442600da I don't see how *len > wanted, but leave the check there.
Stick a comment in there as a 'Waldo was here' so that if I ever see this
again, I realize that I've actually thought about it and didn't think >
was necessary.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97372 13f79535-47bb-0310-9956-ffa450edef68
2002-11-01 09:42:09 +00:00
a75b148a5f Clean up the read pattern for cases when some data already exists.
Also return APR_SUCCESS once we've gathered any decrypted bytes.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97371 13f79535-47bb-0310-9956-ffa450edef68
2002-11-01 09:29:06 +00:00
e2742465a9 Distinguish inctx, outctx, frec [and b ??? looked like bucket to me!!!]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97370 13f79535-47bb-0310-9956-ffa450edef68
2002-11-01 08:58:38 +00:00
62c675067d More nits spotted by Justin, and catch all the errors except SYSCALL
in the SSL logging section.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97369 13f79535-47bb-0310-9956-ffa450edef68
2002-11-01 08:48:35 +00:00
6a63226752 Suggestions by Justin, implemention by Will. Rename away all bogisity,
especially eliminating all of 'our' capitalized identifiers that were
  easily confused with library symbols; go with APR_STATUS_IS_EOF() just
  in case there is a platform result; fix a bogus *len = 0; reassignment
  and fold the two flavors of input context tracking into one.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97368 13f79535-47bb-0310-9956-ffa450edef68
2002-11-01 08:39:59 +00:00
b631a9cc71 Completely refactor the BIO-side client input handling for the SSL library.
Should eliminate many false spurious interrupt detected errors.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97367 13f79535-47bb-0310-9956-ffa450edef68
2002-11-01 08:35:19 +00:00
ea1784b444 Ugg. We need to use '%pp' not '%p' since ap_log_error uses apr_vsnprint(),
which has the overloaded '%p' format (not ANSI).

PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97252 13f79535-47bb-0310-9956-ffa450edef68
2002-10-17 13:25:08 +00:00
658c2437bd This stuff shouldn't have been committed. This is the SSL upgrade stuff,
and it was included in a commit that shouldn't have touched these files.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97201 13f79535-47bb-0310-9956-ffa450edef68
2002-10-14 04:15:58 +00:00
37f9061757 Fix a compile of compiler warnings. I don't know how these slipped past.
Also, uncomment a line of code that the last commit should have uncommented.
Randall found this line and the fix, but I forgot to uncomment this line
along with the fix.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97179 13f79535-47bb-0310-9956-ffa450edef68
2002-10-11 15:29:22 +00:00
798c1dae43 Add a filter_init function to the filters so that a filter can execute
arbitrary code before the handlers are invoked.

This resolves an issue with incorrect 304s on If-Modified-Since mod_include
requests since ap_meets_conditions() is not aware that this is a dynamic
request and it is not possible to satisfy 304 for these requests (unless
xbithack full is on, of course).  When mod_include runs as a filter, it is
too late to set any flag since the handler is responsible for calling
ap_meets_conditions(), which it should do before generating any data.

If a module doesn't need to run such arbitrary code, it can just pass NULL
as the argument and all is well.

PR:	9673
Reviewed by:	Ryan Bloom and others


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95906 13f79535-47bb-0310-9956-ffa450edef68
2002-06-28 08:40:25 +00:00
37f858acc6 Remove all special mod_ssl URIs. This also fixes the bug where
redirecting (.*) will allow an SSL protected page to be viewed
without SSL.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95501 13f79535-47bb-0310-9956-ffa450edef68
2002-06-04 07:12:26 +00:00
50bac91072 stop using APLOG_NOERRNO in calls to ap_log_[pr]error()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95150 13f79535-47bb-0310-9956-ffa450edef68
2002-05-17 11:24:17 +00:00
fafabb637f Remove SSLLog and SSLLogLevel directives in favor of having mod_ssl use the
standard ErrorLog directives.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95129 13f79535-47bb-0310-9956-ffa450edef68
2002-05-16 06:09:13 +00:00
d0214d5ae7 Change mod_ssl from using ssl_log() to ap_log_error().
The issue is that ssl_log doesn't handle apr_status_t result codes.  This
leads to a number of places (esp. with mutexes) where the error codes get
lost.  Rather than extending ssl_log further, since mod_ssl is part of
our core, migrate to ap_log_error.  This means that mod_ssl no longer
does its own logging.

Most uses of SSL_ADD_ERRNO are now mapped correctly to apr_status_t values
(mainly because the APIs that used to return errnos are now APRized and
have apr_status_t codes available).

SSL_LOG_TRACE and SSL_LOG_DEBUG were mapped to the APLOG_DEBUG values.
mod_ssl prints out a LOT of debugging information, so mod_ssl with LogLevel
Debug may not be a good idea - perhaps mod_ssl should be less chatty.

Numerous printf type collisions were also resolved.

(The ssl logging code itself will be removed in a subsequent commit.)

This has been discussed on dev@httpd, but the fact that there isn't
much to review besides the mindless changes, I'm going to commit now
and rely on CTR if I screwed up anything on the translation.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95127 13f79535-47bb-0310-9956-ffa450edef68
2002-05-16 05:17:11 +00:00
d28c4dae36 Stop using SSL_ADD_SSLERR option in ssl_log() and replace with new
ssl_log_ssl_error() function that wraps ap_log_error instead.

This begins the migration from ssl_log() -> ap_log_error().  Divorcing
ourselves from the SSL_ADD_SSLERR option is required to make the next
pass easier.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95122 13f79535-47bb-0310-9956-ffa450edef68
2002-05-15 23:10:33 +00:00
5653644f78 PR:
Obtained from:
Submitted by:
Reviewed by:
ssl_io_input_read now returns APR_EOF if ssl_io_hook_read returns 0
bytes for a reason other than SSL_ERROR_WANT_READ.  this should
prevent a possible endless loop.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94519 13f79535-47bb-0310-9956-ffa450edef68
2002-04-07 06:32:21 +00:00
c1c583494e Get the HTTP-on-HTTPS hint to come through again. We're in AP_MODE_GETLINE
at this point, so the \r\n\r\n just confuses the http input filter.

One concern: this patch is only correct as long as we only ever call this
function while in AP_MODE_GETLINE.  Ideally we would account for the mode
and return the newlines if not in GETLINE mode, but at the moment it doesn't
seem to matter.

Reviewed by: Doug MacEachern


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94453 13f79535-47bb-0310-9956-ffa450edef68
2002-04-05 07:31:44 +00:00
266bd151d1 PR:
Obtained from:
Submitted by:
Reviewed by:    Ryan Bloom
ap_remove_output_filter no longer works for connection filters.
change logic in the case of "HTTP spoken on HTTPS port" to disable the
ssl filters rather than attempt to remove the filters.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94393 13f79535-47bb-0310-9956-ffa450edef68
2002-04-02 17:30:08 +00:00
ada316e24b input filter should not return failure when ssl runtime wants to read more
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94328 13f79535-47bb-0310-9956-ffa450edef68
2002-03-30 05:16:55 +00:00
a12425c133 ssl_io_input_read needs to return something other than APR_SUCCESS
when bucket read from socket was successful,
but there was an error within the ssl runtime.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94327 13f79535-47bb-0310-9956-ffa450edef68
2002-03-30 04:52:48 +00:00
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
c0797583d1 need to flush output buffer before reading in proxy mode
need to call ssl_hook_process_connection in the output filter in proxy
mode, since proxy hits the output filter before the input filter


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94299 13f79535-47bb-0310-9956-ffa450edef68
2002-03-29 07:23:09 +00:00
d5c395f0e7 de-hungarian-ize server config member names which are going to stay
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94264 13f79535-47bb-0310-9956-ffa450edef68
2002-03-28 17:11:12 +00:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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