Provide Win32 users a log of the cgi command invoked, to assist
in debugging scripts, at LogLevel info. Also provide env vars
at LogLevel debug for additional help to admins troubleshooting
the ever mysterious "Premature end of script headers" error.
Since this is the single most common cause of trouble reports on
the newslist, at least this gives us something to point users at.
[Aaron Bannert]
Resolve bugs introduced by my Rev 1.173, which attempted to close
a type mismatch error. This truncation should now produce a random
result, once again. PR 10090, 10185
Bug pinpointed by Jeroen Boomgaardt <jeroen@swissclue.com>
Bradley Nicholes [Wed, 13 Mar 2002 15:58:40 +0000 (15:58 +0000)]
Added the -e command line directive for NetWare to force all fatal
configuration file errors to the logger screen rather than to the Apache
screen. This allows Apache to shutdown cleanly and completely on an
error condition without losing the error information that was written to the
screen or requiring user interaction to close the Apache screen.
Graham Leggett [Sat, 9 Mar 2002 22:25:41 +0000 (22:25 +0000)]
Add the ProxyIOBufferSize option. Previously the size of the
buffer used while reading from the remote server in proxy was
taken from ProxyReceiveBufferSize. These two functions were
similar but not the same, thus the need for the split.
PR:
Obtained from:
Submitted by:
Reviewed by:
Graham Leggett [Fri, 8 Mar 2002 18:35:11 +0000 (18:35 +0000)]
Fix a NULL variable check in proxy where we were checking the
wrong variable.
PR:
Obtained from:
Submitted by: Geff Hanoian <geff@pier64.com>
Reviewed by: Graham Leggett
Bradley Nicholes [Thu, 28 Feb 2002 16:57:57 +0000 (16:57 +0000)]
Logging module for NetWare that implements log rotation. This solves the
log rotation problem for NetWare since the NetWare OS does not support
pipes and can therefore not use the RotateLog utility.
Bill Stoddard [Tue, 26 Feb 2002 14:25:56 +0000 (14:25 +0000)]
Win32: Emulate the blocking send/recv calls that were called in these functions
when the timeout was set to 0. This is a bit of a hack but it is an improvement
over the original code. A better fix would involve making too many other changes
to the server that I would prefer not to make in the 1.3 tree.
Jeff Trawick [Fri, 22 Feb 2002 17:31:06 +0000 (17:31 +0000)]
This patch changes a TPF-specific section of http_main.c to use the
correct subpool when initially opening the error log.
This makes TPF's ap_open_logs call the same as other platforms and
prevents a possible SIGPIPE in standalone_main on TPF.
Submitted by: David McCreedy
Reviewed by: Jeff Trawick
Graham Leggett [Thu, 21 Feb 2002 06:03:08 +0000 (06:03 +0000)]
When proxy enabled a slow frontend client to read from an
expensive backend server, it would wait until it had delivered
the response to the slow frontend client completely before
closing the backend connection. The backend connection is now
closed as soon as the last byte is read from it, freeing up
resources that would have been tied up unnecessarily.
The proxy code read chunks from the backend server in a
hardcoded amount of 8k. The existing ProxyReceiveBufferSize
parameter has been overloaded to specify the size of this buffer.
Martin Kraemer [Fri, 15 Feb 2002 11:32:34 +0000 (11:32 +0000)]
[Security] Prevent invalid client hostnames from appearing in
the log file. If a double-reverse lookup was performed (e.g.,
for an "Allow from .my.domain" directive) but failed, then
a spoofed dns-reverse-address could appear in the logs. Now
the numeric address is logged instead. Note that
reverse-address-spoofing did NOT actually allow access
to any protected resource! It was only possible to cause apache to
log arbitrary names (for resources protected thusly) if you had
control over the reverse dns zone.
Graham Leggett [Wed, 13 Feb 2002 05:35:02 +0000 (05:35 +0000)]
Some browsers ignore cookies that have been merged into a
single Set-Cookie header. Set-Cookie and Set-Cookie2 headers
are now unmerged in the http proxy before being sent to the
client.
PR:
Obtained from:
Submitted by:
Reviewed by:
Graham Leggett [Mon, 11 Feb 2002 21:15:19 +0000 (21:15 +0000)]
Corrected the use of ap_table_set and ap_table_merge:
- Fix a problem with proxy where each entry of a duplicated
header such as Set-Cookie would overwrite and obliterate the
previous value of the header, resulting in multiple header
values (like cookies) going missing.
- Fix a problem with proxy where X-Cache headers were
overwriting and then obliterating upstream X-Cache headers
from other proxies.
PR:
Obtained from:
Submitted by:
Reviewed by:
Bill Stoddard [Sat, 9 Feb 2002 14:51:30 +0000 (14:51 +0000)]
Win32: Eliminate blocking network i/o in the Windows code paths. In practice
only sends() were ever blocking. That any network i/o was ever blocking
could be considered a bug in Apache.
This patch seems to work around a bug in WinXP that causes network write
data corruption. The bug appears to be tickled by the combined use of
WSADuplicateSocket and blocking sends(). Allan Edwards is submitting a
bug report to Microsoft.
Only lower case the canonical name on a call to ap_os_canonical_filename()
if ap_os_case_canonical_filename() fails to retieve the information from the
file system, at least we have the casing from the request.
Ken Coar [Tue, 5 Feb 2002 15:21:55 +0000 (15:21 +0000)]
Demote the 'turned /foo into http://host/foo' message from
WARNING to DEBUG; it's a supported operation, so no need to
fill normal log files with noise. Setting LogLevel to Debug
will show the activity, though.
Martin Kraemer [Mon, 4 Feb 2002 13:57:39 +0000 (13:57 +0000)]
Fix the longstanding bug that errors (returned by src/Configure)
would not be noticed by the top level configure script.
That was bad for automated production environments, as errors would
go thru unnoticed, and caused havoc much later in the production.
Martin Kraemer [Sun, 27 Jan 2002 22:08:30 +0000 (22:08 +0000)]
ftp proxy: various cosmetic and functional improvements
- Allow for /%2f hack (to access the root directory / )
- properly escape generated links in dir listing
- do directory listings in ASCII, to avoid problems with EBCDIC servers
- close data & control channels to server properly
- rename "BUFF f" to "BUFF data" or "BUFF ctrl", depending on its FTP use
Martin Kraemer [Sun, 27 Jan 2002 19:57:55 +0000 (19:57 +0000)]
* Rename "BUFF f" to "BUFF data" or "BUFF ctrl", depending on ftp use
(cosmetics only)
* Make output look more like xhtml (cosmetics only)
* Properly escape file names from ftp directory listing (as HTML or URI)
* Treat ftp rc 421 (closing connection) like -1 (connection was closed)
* fix a possible pointer underrun
Per W. Stoddard, Greg Marr and my research, let's get this right.
This change is a decorative NOOP. It accurately reflects what the
MSVC compiler actuall turned into bytecode. We hope this change
makes the actual fns clearer to the developer.
However, there is no effective difference. The _stdcall declaration
for these functions was _ignored_ by MSVC, which treated the fn's
as _cdecl (our API_EXPORT_NONSTD macro) because they use varargs.
This time, buff.c:ap_bvputs() was out of sync (correct to this patch)
ap_rprintf is implemented as API_EXPORT() in http_protocol.c.
Therefore, make the prototype and implementation consistant.
The question remains, why no compiler warning/emit? Because MSVC [my
version, at least] must have changed all of the ap_fn(foo, ...) decl
from _stdcall to _cdecl, on it's own!
I suggest our declarations are still borked, but they have worked only
because MSVC ignored our poor judgement :)
Several final namespace changes. Exports (with an ap_ prefix!) the
useful sendwithtimeout/recvwithtimeout symbols. How useful? SSL needs
them, and proxy_connect should probably use them as well. And corrects
two newly exported (never released) symbols since they did not require
the _NONSTD semantics.
Dispatch 26 compiler emits into oblivion. Vetting is desired, please
post to the list if you participate. They are all blindingly obvious,
but extra eyes always help
This eliminates all but the regex emits and MSVC's borked misdeclaration
of FD_SET.
Bill Stoddard [Thu, 17 Jan 2002 21:21:09 +0000 (21:21 +0000)]
On HPUX 11.x, the 'ENOBUFS, No buffer space available'
error occures because the accept() cannot complete.
You will not see ENOBUFS at 10.20 because the kernel
hides any occurrence from being returned from user space.
ENOBUFS at 11.0 TCP/IP is quite possible, and could
occur intermittently. As a work-around, we are going to
ingnore ENOBUFS.
Submitted by: madhusudan_mathihalli@hp.com
Reviewed by: Bill Stoddard
Jim Jagielski [Thu, 17 Jan 2002 13:20:51 +0000 (13:20 +0000)]
PR:
Obtained from:
Submitted by: Stipe Tolj <tolj@wapme-systems.de>
Reviewed by:
Add in Stipe's Cygwin changes.... Have not folded in the Cygwin
timeout kill signaling patch yet... waiting for feedback.
Here are the changes:
* src/include/ap_config.h: adding HAVE_PTHREAD_SERIALIZED_ACCEPT to
Cygwin block and defaulting to it.
* src/main/http_main.c: exluding pthread_mutexattr_setpshared() call
for Cygwin platform. This calls seems yet not fully functional on this
platform. Forwarding problem to Cygwin core developers.
* src/Configure: changed OS_MODULE_INCLUDE var for the Cygwin
platform block to refer to the (absolute) relative path for the
Makefile.Cygwin file.
* src/modules/proxy/Makefile.tmpl: target libproxy.dll is hardcoded
for OS/2. That's not good. We have the same target on Cygwin, but use
other calls for it, so if construct here.
* src/modules/standard/Makefile.Cygwin: adding a dummy target %.def
: %.c to satisfy OS/2 related dependacies on Cygwin too. Changed the
"run make twice" screen slightly.
Jeff Trawick [Wed, 16 Jan 2002 15:52:15 +0000 (15:52 +0000)]
fix a syntax error in an initializer which prevented http_main.c from
compiling on at least OS/390, AIX w/ xlc, and HP-UX with HP compiler;
Tru64 cc previously complained but generated code anyway; gcc -Wall
didn't complain before
unfortunately, this introduces a warning with gcc -Wall on Solaris since
in_addr is a union
Bill Stoddard [Tue, 15 Jan 2002 17:27:32 +0000 (17:27 +0000)]
This patch fixes my previous change for argument passing, put in place
to support rotatelogs. It only affects TPF. I was stupidly displacing past
the end of the "args" array while setting up to fork to rotatelogs (or a CGI).
Tony Finch [Mon, 14 Jan 2002 04:49:44 +0000 (04:49 +0000)]
Following taunts from Alfred Perlstein on IRC, use "httpready"
accept filter rather than "dataready" on FreeBSD after 4.1.1-RELEASE
where it works correctly.
Ken Coar [Wed, 9 Jan 2002 19:47:03 +0000 (19:47 +0000)]
Whoops, forgot to bump MMN. Major bump because of a change
to the semi-private core_dir_config structure. (Also fix a
stale comment from an earlier version of the FileETag patch.)
It's clear from recent security reports that including configuration
examples for non-core add-ins with our default .conf files causes some
admins to bypass actually researching -how-to-configure- the given
add-in module. While this example was nice, we need to find another
useful example, in addition to x-tar perhaps, to make this clearer.