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

145 Commits

Author SHA1 Message Date
a8a56e00c5 Switch back to SIGUSR1 for graceful restarts on all platforms that
support it.  This defines a symbol called AP_SIG_GRACEFUL in
ap_config_auto.h which will have the appropriate signal value.  All
direct references to SIGWINCH have been replaced with AP_SIG_GRACEFUL.

On Linux 2.0, use SIGWINCH instead since SIGUSR1 is used by glibc
2.0's user-space threading library to control threads.  All later
versions of Linux/glibc don't have this problem.  (Not to mention the
security holes in older Linux versions which make it unsuitable for
use as a web server.)  If your platform doesn't have SIGUSR1, use the
appropriate mojo in configure to define what your graceful restart
signal should be.

In theory, a configure switch could be added to allow the admin to
specify the appropriate signal that should be used.  This is left
as an exercise to the reader for now.

The docs need to be updated.  Since the signal is now configurable,
just saying SIGUSR1 for graceful restart isn't completely true.  Also,
the apachectl functionality needs to be moved into httpd - this is
what Win32 does and it makes us consistent across platforms.

Roy issued a veto against use of SIGWINCH by default, so this should
resolve that veto.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91076 13f79535-47bb-0310-9956-ffa450edef68
2001-09-18 22:13:59 +00:00
cac07fa8d9 A very small optimization to the OLD_WRITE logic. This just makes us store
a pointer to the OLD_WRITE frec, and instead of using strcmp or strcasecmp,
we can just do a simple pointer comparison.  This optimization is also
available to other modules.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91006 13f79535-47bb-0310-9956-ffa450edef68
2001-09-11 18:38:21 +00:00
4db33d47fd Fix breakage from Brian Pane's util_filter switch to hash tables.
There were some places that were expecting what you put into frec
would be what frec->name would be.  Not true anymore.

There are enough other places that were already doing the strcasecmp
that it makes more sense to just make it all strcasecmp across the
board rather than changing the UPPERCASE to lowercase.

(None of these with the exception of old_filter look to be in the
critical path anyway...)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90890 13f79535-47bb-0310-9956-ffa450edef68
2001-09-04 07:59:55 +00:00
3663a64d3c Make test for EAGAIN portable in content length filter. This fixes some
failures in CGIs on OS/2.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90394 13f79535-47bb-0310-9956-ffa450edef68
2001-08-20 10:56:44 +00:00
2090fa8748 adjust to apr_uri_ rename
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90361 13f79535-47bb-0310-9956-ffa450edef68
2001-08-19 16:01:05 +00:00
923b7a1bdb We can't use a static buffer for this patch, because that wouldn't
be thread safe.
Submitted by:	Greg Marr <gregm@alum.wpi.edu>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90214 13f79535-47bb-0310-9956-ffa450edef68
2001-08-16 14:05:00 +00:00
12aad48bed Fix ap_rvprintf to support more than 4K of data.
Submitted by:	Cody Sherr <csherr@covalent.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90189 13f79535-47bb-0310-9956-ffa450edef68
2001-08-16 05:04:39 +00:00
556941bf1d Back out a patch that wasn't ready for inclusion. Thanks to OtherBill
for pointing out that this was committed when it shouldn't have been.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89990 13f79535-47bb-0310-9956-ffa450edef68
2001-08-07 16:40:25 +00:00
cf2e6a1831 Remove all warnings from the input filtering stack.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89987 13f79535-47bb-0310-9956-ffa450edef68
2001-08-07 16:19:03 +00:00
85e8fbd0e2 Add the ability to extend the methods that Apache understands
and have those methods <limit>able in the httpd.conf. It uses
the same bit mask/shifted offset as the original HTTP methods
such as M_GET or M_POST, but expands the total bits from an int to
an ap_int64_t to handle more bits for new request methods than
an int provides.
Submitted by:	Cody Sherr <csherr@covalent.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89869 13f79535-47bb-0310-9956-ffa450edef68
2001-08-02 04:25:20 +00:00
c901f4e726 Coexist within the XHTML changes to http_protocol.c
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89780 13f79535-47bb-0310-9956-ffa450edef68
2001-07-30 04:38:02 +00:00
10f9a8910c More obsessive changes to meet HTML 3.2, HTML 4.01 Transitional and
XHTML 1.0 Transitional


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89750 13f79535-47bb-0310-9956-ffa450edef68
2001-07-28 00:46:49 +00:00
9ffcdaf02b Reduce CPU consumption in conv_10 function, used to format "%d" by apr_*printf
This includes two changes to APR:
  * new functions apr_itoa, apr_ltoa, and apr_off_t_toa
    that provide itoa-type functionality based on pools
  * Inline code in inet_ntop4 to replace sprintf for converting
    binary IP addresses into dotted-decimal format

and two changes to Apache:
  * use the apr_itoa functions in setting the content length,
    in place of apr_psprintf
  * use the apr_itoa functions to replace frequent uses of
    'sprintf("%d",...)' in mod_log_config.

Submitted by: Brian Pane
Reviewed by:  Dean Gaudet, Greg Ames


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89686 13f79535-47bb-0310-9956-ffa450edef68
2001-07-24 22:55:29 +00:00
80692df384 A couple of optimizations to the content_length filter.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89684 13f79535-47bb-0310-9956-ffa450edef68
2001-07-24 21:33:44 +00:00
48e11e3998 Grrr.. Cliff warned me about this. APR should return APR_SUCCESS with
zero bytes read rather than APR_EOF. Will work on APR later...


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89508 13f79535-47bb-0310-9956-ffa450edef68
2001-07-06 19:49:47 +00:00
a4273dbb11 Reimplement content length filter to fix problem where all output from
CGI scripts was being buffered in the brigade before any of it was
written to the network. cl filter now honors flush and implements a
buffer threshold.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89503 13f79535-47bb-0310-9956-ffa450edef68
2001-07-06 00:28:41 +00:00
6e2195d7df Do non-blocking reads from pipes in the content-length filter.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89501 13f79535-47bb-0310-9956-ffa450edef68
2001-07-05 14:58:03 +00:00
29212e8c6b *) Account for the new pool parameter to apr_bucket_file_create()
and apr_bucket_file_make().

*) Simplify mod_file_cache's sendfile_handler by taking advantage
   the new ability of file buckets to handle files opened in XTHREAD
   mode.  [Also inlined some of the brigade construction stuff in
   mod_file_cache's handlers to save a palloc() or two.]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89438 13f79535-47bb-0310-9956-ffa450edef68
2001-06-27 20:18:09 +00:00
afaf899642 Back out the change to allocate files out of the main request pool, and
implement pool-based setaside for FILE and MMAP buckets.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89370 13f79535-47bb-0310-9956-ffa450edef68
2001-06-14 22:56:12 +00:00
66a61c359d Add a pool to the ap_save_brigade prototype. This removes a todo from
the comments that is really necessary before the setaside stuff will
work properly.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89362 13f79535-47bb-0310-9956-ffa450edef68
2001-06-13 13:44:40 +00:00
e1464feb18 use apr-util's apr_date_parse_http() instead of the to-be-removed
ap_parseHTTPdate()

(proxy needs to make similar changes)

build changes forthcoming...

Submitted by:	Justin Erenkrantz


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89277 13f79535-47bb-0310-9956-ffa450edef68
2001-06-06 19:30:54 +00:00
1fe44dacde Move the addition of default AP_HTTP_HTTP_HEADER filters to the
insert_filter phase so that other filters are not bypassed by default.
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89252 13f79535-47bb-0310-9956-ffa450edef68
2001-06-01 17:26:19 +00:00
654a74cbae back out filter change that is preventing headers to be sent
PR:
Obtained from:
Submitted by: john sterling
Reviewed by:	dougm


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89239 13f79535-47bb-0310-9956-ffa450edef68
2001-05-30 05:18:33 +00:00
43b9634ceb Moved util_uri to apr-util/uri/apr_uri, which means adding the apr_
prefix to all of the uri functions (yuck), changing some includes,
and using APR error codes instead of HTTP-specific error codes.

Other notes to test this patch:
- You need to delete the util_uri.h file - exports picks up on this.
- I'd like to remove the apr_uri.h from httpd.h, but that might
  increase the complexity of this patch even further.  Once this patch
  is accepted (in some form), then I can focus on removing apr_uri.h
  from httpd.h entirely.  I need baby steps (heh) right now.
- I imagine that this might break a bunch of stuff in Win32 or other OS
  builds with foreign dependency files.  Any help here is appreciated.

This is a start...  -- justin

Submitted by:	Justin Erenkrantz
Reviewed by:	Roy Fielding


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89198 13f79535-47bb-0310-9956-ffa450edef68
2001-05-22 01:31:12 +00:00
3fdc9ca62a Move the addition of default AP_HTTP_HTTP_HEADER filters to the insert_filter
phase so that other filters are not bypassed by default.
PR:
Obtained from:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89196 13f79535-47bb-0310-9956-ffa450edef68
2001-05-21 23:47:21 +00:00
ea5640f142 fix the type of a parameter to ap_get_brigade()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89045 13f79535-47bb-0310-9956-ffa450edef68
2001-05-07 10:01:31 +00:00
1c98aabbf1 Back out the recent change to ap_get_brigade, to make it use indirection
again.  The problem is that the amount of data read from the network,
is not necessarily the amount of data returned from the filters.  It is
possible for input filters to add bytes to the data read from the network.

To fix the original bug, I just removed the line from ap_get_client_block
that decremented r->remaining, we allow the http_filter to do that for
us.

I have also removed an incorrect comment.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89041 13f79535-47bb-0310-9956-ffa450edef68
2001-05-06 23:27:14 +00:00
5cba6d7345 Fix a bug in the input handling. ap_http_filter() was modifying *readbytes
which corresponded to r->remaining (in ap_get_client_block). However,
ap_get_client_block was *also* adjusting r->remaining. Net result was that
PUT (and probably POST) was broken. (at least on large inputs)

To fix it, I simply removed the indirection on "readbytes" for input
filters. There is no reason for them to return data (the brigade length is
the return length). This also simplifies a number of calls where people
needed to do &zero just to pass zero.

I also added a number of comments about operations and where things could be
improved, or are (semi) broken.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89008 13f79535-47bb-0310-9956-ffa450edef68
2001-05-05 11:18:01 +00:00
a529c242fa Removed the keptalive boolean from conn_rec because it is now only
used by a single routine and can be replaced by a local variable.

Submitted by:	Greg Stein, Ryan Bloom, Roy Fielding


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88938 13f79535-47bb-0310-9956-ffa450edef68
2001-04-26 00:33:14 +00:00
eb94b557ee At the hack-athon we decided to change the way that input filters
determine how much data is returned to the previous filter.  Prior to this
change, we used a field in the conn_rec to determine how much to return.
After this change, we use an argument to ap_get_brigade.  This makes it
much more obvious how things work at all levels, so that module authors
can easily determine how much data is supposed to be returned to them.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88912 13f79535-47bb-0310-9956-ffa450edef68
2001-04-22 22:19:32 +00:00
4647e5f71a Revert the change that moved keepalives out of conn_rec. That variable
controls the number of requests per connection, regardless of the protocol
used by the request.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88908 13f79535-47bb-0310-9956-ffa450edef68
2001-04-21 12:23:37 +00:00
17df005db7 Don't overwrite r->the_request. This was causing us to never get the
request in the access_log


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88885 13f79535-47bb-0310-9956-ffa450edef68
2001-04-18 20:46:46 +00:00
70a67b2c26 Move the keepalives field out of the conn_rec and into an HTTP specific
connection record.  This also moves some HTTP specific back out of the
core and into the HTTP module.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88881 13f79535-47bb-0310-9956-ffa450edef68
2001-04-18 03:53:34 +00:00
3cba58c98f When I initially pulled the BYTERANGE filter into the core, Greg Stein
told me I was wrong.  I was wrong, and Greg was right.  This commit
just moves the byterange filter and its related functions out of the core,
and puts them back in the HTTP specific module.
Submitted by:	Greg Stein


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88815 13f79535-47bb-0310-9956-ffa450edef68
2001-04-11 23:37:16 +00:00
e845552895 Move ap_set_last_modified to the core. This is a potentially
controversial change, because this is kind of HTTP specific.  However
many protocols should be able to take advantage of this kind of
information.  I expect that headers will need one more layer of
indirection for multi-protocol work, but this is a small step in
the right direction.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88580 13f79535-47bb-0310-9956-ffa450edef68
2001-03-25 20:42:47 +00:00
30eeae757c back out the logging of read errors in getline. daedalus was logging
boatloads of "(54)Connection reset by peer: ap_get_brigade() failed" errors.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88553 13f79535-47bb-0310-9956-ffa450edef68
2001-03-21 02:20:00 +00:00
5f6998ec20 Empty out the brigade shared by ap_getline()/ap_get_client_block()
on error exit from ap_getline().  Some other code got upset because
the wrong data was in the brigade.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88552 13f79535-47bb-0310-9956-ffa450edef68
2001-03-20 21:40:50 +00:00
9b13772f87 Handle ap_discard_request_body() being called more than once.
Add a debug assertion to verify that c->remain is zero when a new
request starts.  ap_http_filter() does the wrong thing otherwise.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88540 13f79535-47bb-0310-9956-ffa450edef68
2001-03-19 21:54:57 +00:00
895b7b26ac Add a hook, create_request. This hook allows modules to modify
a request while it is being created.  This hook is called for all
request_rec's, main request, sub request, and internal redirect.
When this hook is called, the the r->main, r->prev, r->next
pointers have been set, so modules can determine what kind of
request this is.

Currently, this is only used by the core module, but protocol modules
are going to need to have the ability to affect the request while it is
being read.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88532 13f79535-47bb-0310-9956-ffa450edef68
2001-03-18 02:33:23 +00:00
93463cfc17 This is a fix that went into v1.3 quite a while back, but not into v2.0.
It sorts out the problem when a password protected reverse proxy URL
sends a Proxy-Authenticate to a browser instead of a WWW-Authenticate.

This patch covers the changes to the httpd-2.0 tree.

Submitted by:	Graham Leggett
Reviewed by:	Chuck Murcko


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88527 13f79535-47bb-0310-9956-ffa450edef68
2001-03-16 07:28:08 +00:00
0296354880 Avoid using sscanf to determine the HTTP protocol number in
the common case because sscanf is a performance hog. From
Mike Abbot's Accelerating Apache patch number 6.

Submitted by: Mike Abbot <mja@trudge.engr.sgi.com>
Reviewed by: Bill Stoddard


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88523 13f79535-47bb-0310-9956-ffa450edef68
2001-03-16 04:17:38 +00:00
48c376abcf Fix content-length computation. We ONLY compute a content-length if
We are not in a 1.1 request and we cannot chunk, and this is a keepalive
or we already have all the data.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88464 13f79535-47bb-0310-9956-ffa450edef68
2001-03-07 17:01:28 +00:00
3358c41372 Make the old_write filter use the ap_f* functions for buffering the data.
This has been tested with a couple of directory listings, but it could
probably use a bit more testing before being declared stable.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88454 13f79535-47bb-0310-9956-ffa450edef68
2001-03-05 06:16:28 +00:00
0cf2c99cf5 Another missing AP_DECLARE mismatch
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88389 13f79535-47bb-0310-9956-ffa450edef68
2001-02-28 15:13:30 +00:00
4296146043 Begin to move functions from the http module to the core. The goal is to
have only functions that are HTTP specific in the http directory.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88341 13f79535-47bb-0310-9956-ffa450edef68
2001-02-26 04:38:22 +00:00