Commit Graph

53 Commits

Author SHA1 Message Date
aa532ee243 Get mod_file_cache to refuse to compile on systems with neither
sendfile nor mmap.

Get mod_file_cache to compile on systems with sendfile but !mmap.

Submitted by:	Greg Stein


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88623 13f79535-47bb-0310-9956-ffa450edef68
2001-03-31 11:51:16 +00:00
808ca404c6 get rid of an unused variabe in file_cache_xlat()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88591 13f79535-47bb-0310-9956-ffa450edef68
2001-03-26 23:40:41 +00:00
16a82e270b Get mod_file_cache to compile again on platforms with no apr_sendfile().
Get the Tru64 compiler to shut up about an incompatibility between void **
and struct **.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88589 13f79535-47bb-0310-9956-ffa450edef68
2001-03-26 19:11:09 +00:00
b951f8b0c7 Eat our own cooking. Cleanup code paths and use apr_hash functions. Good
for a small performance boost.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88586 13f79535-47bb-0310-9956-ffa450edef68
2001-03-26 18:01:17 +00:00
16231360f1 Goodbye ap_send_http_header
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88390 13f79535-47bb-0310-9956-ffa450edef68
2001-02-28 15:24:09 +00:00
e26706be5c use the right fmt string for finfo.size
Submitted by:	Greg Stein and gcc on FreeBSD


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88309 13f79535-47bb-0310-9956-ffa450edef68
2001-02-25 00:38:17 +00:00
1db0d496ec Modify mod_file_cache to save pre-formatted strings for
content-length and last-modified headers for performance.

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@88292 13f79535-47bb-0310-9956-ffa450edef68
2001-02-23 18:57:36 +00:00
381f88d56a Update copyright to 2001
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88184 13f79535-47bb-0310-9956-ffa450edef68
2001-02-16 04:26:53 +00:00
5dc34feb12 *) continued header revamping
*) torch some headers (and some libs) from the autoconf stuff


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88061 13f79535-47bb-0310-9956-ffa450edef68
2001-02-10 14:04:21 +00:00
88d3406f9a renaming various functions for consistency sake
see: http://apr.apache.org/~dougm/apr_rename.pl
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88019 13f79535-47bb-0310-9956-ffa450edef68
2001-02-08 07:45:33 +00:00
7f4a5fe7f5 Use the appropriate APR_FINFO_flags for the apr_stat/lstat/getfileinfo
calls to avoid ownership and permissions on Win32 when they are not
  required, and until they are implemented.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87873 13f79535-47bb-0310-9956-ffa450edef68
2001-01-27 21:28:28 +00:00
cd1ef027c2 The changes required for the APR_FINFO_wanted argument to
apr_stat/lstat/getfileinfo.  These are -NOT- optimal, they
  are simply the required changes to get the server working.
  The size of the patch is a warning about how we need to
  really look at what we are trying to accomplish with all
  of these stat/lstat calls.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87760 13f79535-47bb-0310-9956-ffa450edef68
2001-01-20 21:42:23 +00:00
59bbd68bec The big change. This is part 3 of the apr-util symbols rename, please
see the first commit of srclib/apr-util/include (cvs apr-util/include)
  for the quick glance at symbols changed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87731 13f79535-47bb-0310-9956-ffa450edef68
2001-01-19 07:04:36 +00:00
40655f8641 Provide apr_pool_t arg to register_hooks, since anything they do in that
step -must- be done with a pool that will not outlive the cmd pool, from
  which they may have been dynamically loaded.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87697 13f79535-47bb-0310-9956-ffa450edef68
2001-01-17 15:52:12 +00:00
9a73c1fca8 get rid of an unused variable
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87658 13f79535-47bb-0310-9956-ffa450edef68
2001-01-11 20:14:04 +00:00
d88b08d746 It is not sufficient to reset the file pointer before each call to ap_send_fd. A better solution
is to make certain that only apr_sendfile() will be used to send content with a cached file handle.
This assumes that apr_sendfile() should not rely on the position of the file pointer. I suspect that
sendfile implementations that rely on the position of the file pointer are broken and we should not
use sendfile on those platforms.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87654 13f79535-47bb-0310-9956-ffa450edef68
2001-01-11 18:50:09 +00:00
06c2846624 use AP_HOOK_LAST for this module. This may or may not be the final
solution but it is at least more correct.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87634 13f79535-47bb-0310-9956-ffa450edef68
2001-01-09 21:38:35 +00:00
55e9bcf8e7 use ap_strcmp_match and fix pattern typo
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87618 13f79535-47bb-0310-9956-ffa450edef68
2001-01-09 00:08:13 +00:00
40391fb9f2 adjust remaining modules to use the new handler hook method (Alan Edwards)
bring back the old handler prototype by reusing r->handler (dougm)
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87617 13f79535-47bb-0310-9956-ffa450edef68
2001-01-08 23:55:12 +00:00
78309d6d21 Get rid of the once_through flag. It is never used and doesn't work
in DSO mode anyway.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87329 13f79535-47bb-0310-9956-ffa450edef68
2000-12-13 13:22:51 +00:00
1e453f2369 Port httpd to the newest MMAP api.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87243 13f79535-47bb-0310-9956-ffa450edef68
2000-12-07 05:01:01 +00:00
8662bacbc4 When caching file handles (vs. mmaps) reset the file pointer
before serving, since a filter may have caused the file pointer
to advance.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86876 13f79535-47bb-0310-9956-ffa450edef68
2000-11-08 23:07:32 +00:00
5d452728e4 Remove the byterange code out of mod_file_cache's handler. That
is completely in the core now.

Note that file handle caching is broken (nothing to do with
byte ranges).  mmap caches seem to work o.k.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86873 13f79535-47bb-0310-9956-ffa450edef68
2000-11-08 19:07:34 +00:00
9904e8589a ap_set_content_length() now has a void return.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86863 13f79535-47bb-0310-9956-ffa450edef68
2000-11-08 03:12:58 +00:00
f076d872e4 Avoid warning about unused function open_file() on systems
with no sendfile().


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86859 13f79535-47bb-0310-9956-ffa450edef68
2000-11-07 22:12:36 +00:00
d6490633eb Renamed all MODULE_EXPORT symbols to AP_MODULE_DECLARE and all symbols
for CORE_EXPORT to AP_CORE_DECLARE (namespace protecting the wrapper)
  and retitled API_EXPORT as AP_DECLARE and APR_EXPORT as APR_DECLARE.
  All _VAR_ flavors changes to _DATA to be absolutely clear.
  Thank you Greg, for the most obvious suggestion.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86609 13f79535-47bb-0310-9956-ffa450edef68
2000-10-16 06:05:15 +00:00
25fb26a452 Fix some bad calls to ap_log_error(); some of these neglected to
turn on APLOG_NOERRNO even though no syscall failure was being
reported; others passed errno instead of the APR retcode.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86378 13f79535-47bb-0310-9956-ffa450edef68
2000-10-03 21:48:31 +00:00
07cb423648 The previous commit pointed out an unfortunate problem with the
ap_os_case_canonical_filename() interface: It returns const char * on
platforms where no mapping is ever performed but char * on platforms
where mapping can occur.  Such a discrepancy seems to be a good choice,
as no platform is penalized with extra pathlength.

This tweak gets rid of a const misuse warning on systems where
ap_os_case_canonical_filename() returns const char *.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86376 13f79535-47bb-0310-9956-ffa450edef68
2000-10-03 15:05:26 +00:00
ceedcbda2f Definately need a canonical name, so comparison succeeds at run time.
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86375 13f79535-47bb-0310-9956-ffa450edef68
2000-10-03 13:11:25 +00:00
bb4706d2eb Let ap_send_fd handle the error logging to eliminate duplicate error log entries.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86080 13f79535-47bb-0310-9956-ffa450edef68
2000-08-15 12:54:08 +00:00
00e5a6559a Remove the sendfile_handler (was #if 0'ed out) that does the buffer hi-jack
trick in order to send the headers out on the sendfile call. Besides, BUFF is
going away with brigades and filters...


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86079 13f79535-47bb-0310-9956-ffa450edef68
2000-08-15 12:47:46 +00:00
1a9db204f5 Remaining cleanup of ap_ -> apr_ and AP_ -> APR_ transformation...
see src/lib/apr/apr_compat.h for most details.
  Also a few minor nits to get Win32 to build.

PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86008 13f79535-47bb-0310-9956-ffa450edef68
2000-08-06 06:07:53 +00:00
059d8dd212 prefix libapr functions and types with apr_
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85976 13f79535-47bb-0310-9956-ffa450edef68
2000-08-02 05:27:38 +00:00
992516b075 Fix some compile warnings in mod_file_cache.
Submitted by:	Greg Ames
Reviewed by:	Jeff Trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85893 13f79535-47bb-0310-9956-ffa450edef68
2000-07-26 14:03:08 +00:00
fc3580dd3b Missing apr_strings.h - hope this wasn't destined for some global header.
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85877 13f79535-47bb-0310-9956-ffa450edef68
2000-07-25 00:58:22 +00:00
fccf46923f Protect some sendfile()-specific logic with APR_HAS_SENDFILE
so that mod_file_cache can build on a system with no sendfile().


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85863 13f79535-47bb-0310-9956-ffa450edef68
2000-07-20 18:19:36 +00:00
6aa73a79bc Reimplement ap_send_fd. Eliminate ap_send_fd_length. If APR_HAS_SENDFILE is
defined but ap_sendfile fails with APR_ENOTIMPL, the BUFF implementation
of ap_send_fd will get a shot at serving the request.  This fix is
required to get Apache working on 95/98 again and can also be useful on
Unix systems where sendfile is available via a servicepack/fixpack/PTF
on a particular level of the OS (e.g., AIX 4.3.2 base does not include
sendfile but is is available with a PTF).

This fix also reimplements the mod_file_cache sendfile_handler using
ap_send_fd and sets the connection aborted flag if the sendfile fails.

Future modification... Add code to ap_send_fd to hijack any data in the
client BUFF structure and send it along with the sendfile.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85810 13f79535-47bb-0310-9956-ffa450edef68
2000-07-10 21:49:22 +00:00
ffe8e43370 This patch fixes several problems with mod_file_cache
- Pool usage problem
- SIGSEGVs when both MMapFile and CacheFile directives are present.  The fix combines
the cleanup routines and only cleans up resources when appropriate.
- Log sendfile errors.

Submitted by:	Greg Ames
Reviewed by:	Bill Stoddard


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85781 13f79535-47bb-0310-9956-ffa450edef68
2000-07-07 02:39:00 +00:00
9c61a685e5 Do not set the sendfile flag to disconnect the socket when sending byteranges.
Thanks to Jeff Trawick for pointing this one out.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85776 13f79535-47bb-0310-9956-ffa450edef68
2000-07-06 15:56:45 +00:00
edb2fa4611 WinNT: Implement acceptex socket reuse. Make sure that the ap_sendfile flags
argument is properly initialized for all platforms.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85775 13f79535-47bb-0310-9956-ffa450edef68
2000-07-06 15:13:30 +00:00
8c045570e0 Get rid of some warnings in mod_file_cache by moving to the
new command-handler initialization macros.
Submitted by:	Greg Ames
Reviewed by:	Jeff Trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85769 13f79535-47bb-0310-9956-ffa450edef68
2000-07-05 18:52:57 +00:00
8e6d46add2 struct a_file needs field mm to compile at all when
APR_HAS_MMAP is defined

check for APR_HAS_SENDFILE around the declaration of
file; most of the other sendfile logic does this already
Submitted by:	Greg Ames
Reviewed by:	Jeff Trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85768 13f79535-47bb-0310-9956-ffa450edef68
2000-07-05 18:44:37 +00:00
2676c406ea First cut at getting mod_mmap_static function into mod_file_cache. My intent is to
retire mod_mmap_static.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85727 13f79535-47bb-0310-9956-ffa450edef68
2000-06-28 19:19:46 +00:00
8bcc58ed26 Update mod_file_cache to use ap_core_translate. mod_file_cache is essentially identical
to mod_mmap_static now. Time to merge the two together...


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85724 13f79535-47bb-0310-9956-ffa450edef68
2000-06-28 14:46:01 +00:00
02a2200fd8 blast the old names for the status codes
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85686 13f79535-47bb-0310-9956-ffa450edef68
2000-06-24 17:34:11 +00:00
750d8cc03c Protect system header files with the appropriate macros.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85558 13f79535-47bb-0310-9956-ffa450edef68
2000-06-12 23:03:05 +00:00
16748b4e22 Remove the final vestiges of stat.h from Apache 2.0. All calls are now to
ap_stat.  This also adds the new function ap_lstat().  This function is
analogous to lstat.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85535 13f79535-47bb-0310-9956-ffa450edef68
2000-06-12 15:29:09 +00:00
da493b8be1 PR:
Obtained from:
Submitted by:
Reviewed by:

  Reverse out all _EXPORT_VAR changes back to their original _VAR_EXPORT
  names for linkage (API_, CORE_, and MODULE_).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85318 13f79535-47bb-0310-9956-ffa450edef68
2000-05-27 22:40:44 +00:00
86e2a18f2a This patch corrects the issues from the AP_EXPORT and linkage
specification arguments to the ap_hooks.h declarations.  As with
  the APR_ and AP_ patches, API_VAR_EXPORT becomes API_EXPORT_VAR,
  and MODULE_VAR_EXPORT becomes MODULE_EXPORT_VAR.

  I will be happy to revert the inclusion of ap_config.h from 
  httpd.h if this bothers anyone.  More individual modules need
  to be patched if we do so.

  The API_EXPORTs all moved into central storage in the ap_config.h
  header.  Without WIN32 or API_STATIC compile time declarations, 
  these macros remain no-ops.

  This patch also moves the following data from http_main to http_config:

    const char *ap_server_argv0;
    const char *ap_server_root;
    ap_array_header_t *ap_server_pre_read_config;
    ap_array_header_t *ap_server_post_read_config;
    ap_array_header_t *ap_server_config_defines;

  And the following variables had already moved into ap_hooks.c:

    ap_pool_t *g_pHookPool;  (initialized now in http_config)
    int g_bDebugHooks;                   (out of http_config)
    const char *g_szCurrentHookName;     (out of http_config)

  The changes to http_main.c are in preparation for that module to
  move out to a seperate .exe for win32.  Other platforms will be
  unaffected, outside of these changes.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85309 13f79535-47bb-0310-9956-ffa450edef68
2000-05-27 05:28:02 +00:00
f2ab73eb3b Why should Ryan have all the fun?
Cleans up compiler warning emits.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85263 13f79535-47bb-0310-9956-ffa450edef68
2000-05-19 23:24:19 +00:00