1
0
Fork 0

Adding upstream version 2.4.63.

Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
This commit is contained in:
Daniel Baumann 2025-06-22 11:01:26 +02:00
parent 93c6f9029a
commit 7263481e48
Signed by: daniel.baumann
GPG key ID: BCC918A2ABD66424
3104 changed files with 900776 additions and 0 deletions

54
modules/cache/.indent.pro vendored Normal file
View file

@ -0,0 +1,54 @@
-i4 -npsl -di0 -br -nce -d0 -cli0 -npcs -nfc1
-TBUFF
-TFILE
-TTRANS
-TUINT4
-T_trans
-Tallow_options_t
-Tapache_sfio
-Tarray_header
-Tbool_int
-Tbuf_area
-Tbuff_struct
-Tbuffy
-Tcmd_how
-Tcmd_parms
-Tcommand_rec
-Tcommand_struct
-Tconn_rec
-Tcore_dir_config
-Tcore_server_config
-Tdir_maker_func
-Tevent
-Tglobals_s
-Thandler_func
-Thandler_rec
-Tjoblist_s
-Tlisten_rec
-Tmerger_func
-Tmode_t
-Tmodule
-Tmodule_struct
-Tmutex
-Tn_long
-Tother_child_rec
-Toverrides_t
-Tparent_score
-Tpid_t
-Tpiped_log
-Tpool
-Trequest_rec
-Trequire_line
-Trlim_t
-Tscoreboard
-Tsemaphore
-Tserver_addr_rec
-Tserver_rec
-Tserver_rec_chain
-Tshort_score
-Ttable
-Ttable_entry
-Tthread
-Tu_wide_int
-Tvtime_t
-Twide_int

3
modules/cache/Makefile.in vendored Normal file
View file

@ -0,0 +1,3 @@
include $(top_srcdir)/build/special.mk

262
modules/cache/NWGNUcach_dsk vendored Normal file
View file

@ -0,0 +1,262 @@
#
# Declare the sub-directories to be built here
#
SUBDIRS = \
$(EOLIST)
#
# Get the 'head' of the build environment. This includes default targets and
# paths to tools
#
include $(AP_WORK)/build/NWGNUhead.inc
#
# build this level's files
#
# Make sure all needed macro's are defined
#
#
# These directories will be at the beginning of the include list, followed by
# INCDIRS
#
XINCDIRS += \
$(APR)/include \
$(APRUTIL)/include \
$(AP_WORK)/include \
$(AP_WORK)/server/mpm/netware \
$(NWOS) \
$(EOLIST)
#
# These flags will come after CFLAGS
#
XCFLAGS += \
$(EOLIST)
#
# These defines will come after DEFINES
#
XDEFINES += \
$(EOLIST)
#
# These flags will be added to the link.opt file
#
XLFLAGS += \
$(EOLIST)
#
# These values will be appended to the correct variables based on the value of
# RELEASE
#
ifeq "$(RELEASE)" "debug"
XINCDIRS += \
$(EOLIST)
XCFLAGS += \
$(EOLIST)
XDEFINES += \
$(EOLIST)
XLFLAGS += \
$(EOLIST)
endif
ifeq "$(RELEASE)" "noopt"
XINCDIRS += \
$(EOLIST)
XCFLAGS += \
$(EOLIST)
XDEFINES += \
$(EOLIST)
XLFLAGS += \
$(EOLIST)
endif
ifeq "$(RELEASE)" "release"
XINCDIRS += \
$(EOLIST)
XCFLAGS += \
$(EOLIST)
XDEFINES += \
$(EOLIST)
XLFLAGS += \
$(EOLIST)
endif
#
# These are used by the link target if an NLM is being generated
# This is used by the link 'name' directive to name the nlm. If left blank
# TARGET_nlm (see below) will be used.
#
NLM_NAME = cach_dsk
#
# This is used by the link '-desc ' directive.
# If left blank, NLM_NAME will be used.
#
NLM_DESCRIPTION = Apache $(VERSION_STR) Memory Cache Sub-Module
#
# This is used by the '-threadname' directive. If left blank,
# NLM_NAME Thread will be used.
#
NLM_THREAD_NAME = $(NLM_NAME)
#
# If this is specified, it will override VERSION value in
# $(AP_WORK)/build/NWGNUenvironment.inc
#
NLM_VERSION =
#
# If this is specified, it will override the default of 64K
#
NLM_STACK_SIZE = 65536
#
# If this is specified it will be used by the link '-entry' directive
#
NLM_ENTRY_SYM =
#
# If this is specified it will be used by the link '-exit' directive
#
NLM_EXIT_SYM =
#
# If this is specified it will be used by the link '-check' directive
#
NLM_CHECK_SYM =
#
# If this is specified it will be used by the link '-flags' directive
#
NLM_FLAGS =
#
# If this is specified it will be linked in with the XDCData option in the def
# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled
# by setting APACHE_UNIPROC in the environment
#
XDCDATA =
#
# Declare all target files (you must add your files here)
#
#
# If there is an NLM target, put it here
#
TARGET_nlm = \
$(OBJDIR)/$(NLM_NAME).nlm \
$(EOLIST)
#
# If there is an LIB target, put it here
#
TARGET_lib = \
$(EOLIST)
#
# These are the OBJ files needed to create the NLM target above.
# Paths must all use the '/' character
#
FILES_nlm_objs = \
$(OBJDIR)/mod_cache_disk.o \
$(EOLIST)
#
# These are the LIB files needed to create the NLM target above.
# These will be added as a library command in the link.opt file.
#
FILES_nlm_libs = \
$(PRELUDE) \
$(EOLIST)
#
# These are the modules that the above NLM target depends on to load.
# These will be added as a module command in the link.opt file.
#
FILES_nlm_modules = \
Apache2 \
Libc \
mod_cach \
$(EOLIST)
#
# If the nlm has a msg file, put it's path here
#
FILE_nlm_msg =
#
# If the nlm has a hlp file put it's path here
#
FILE_nlm_hlp =
#
# If this is specified, it will override $(NWOS)\copyright.txt.
#
FILE_nlm_copyright =
#
# Any additional imports go here
#
FILES_nlm_Ximports = \
@libc.imp \
@aprlib.imp \
@httpd.imp \
@mod_cache.imp \
$(EOLIST)
#
# Any symbols exported to here
#
FILES_nlm_exports = \
cache_disk_module \
$(EOLIST)
#
# These are the OBJ files needed to create the LIB target above.
# Paths must all use the '/' character
#
FILES_lib_objs = \
$(EOLIST)
#
# implement targets and dependancies (leave this section alone)
#
libs :: $(OBJDIR) $(TARGET_lib)
nlms :: libs $(TARGET_nlm)
#
# Updated this target to create necessary directories and copy files to the
# correct place. (See $(AP_WORK)/build/NWGNUhead.inc for examples)
#
install :: nlms FORCE
#
# Any specialized rules here
#
#
# Include the 'tail' makefile that has targets that depend on variables defined
# in this makefile
#
include $(APBUILD)/NWGNUtail.inc

263
modules/cache/NWGNUcach_socache vendored Normal file
View file

@ -0,0 +1,263 @@
#
# Declare the sub-directories to be built here
#
SUBDIRS = \
$(EOLIST)
#
# Get the 'head' of the build environment. This includes default targets and
# paths to tools
#
include $(AP_WORK)/build/NWGNUhead.inc
#
# build this level's files
#
# Make sure all needed macro's are defined
#
#
# These directories will be at the beginning of the include list, followed by
# INCDIRS
#
XINCDIRS += \
$(APR)/include \
$(APRUTIL)/include \
$(SRC)/include \
$(STDMOD)/generators \
$(SERVER)/mpm/netware \
$(NWOS) \
$(EOLIST)
#
# These flags will come after CFLAGS
#
XCFLAGS += \
$(EOLIST)
#
# These defines will come after DEFINES
#
XDEFINES += \
$(EOLIST)
#
# These flags will be added to the link.opt file
#
XLFLAGS += \
$(EOLIST)
#
# These values will be appended to the correct variables based on the value of
# RELEASE
#
ifeq "$(RELEASE)" "debug"
XINCDIRS += \
$(EOLIST)
XCFLAGS += \
$(EOLIST)
XDEFINES += \
$(EOLIST)
XLFLAGS += \
$(EOLIST)
endif
ifeq "$(RELEASE)" "noopt"
XINCDIRS += \
$(EOLIST)
XCFLAGS += \
$(EOLIST)
XDEFINES += \
$(EOLIST)
XLFLAGS += \
$(EOLIST)
endif
ifeq "$(RELEASE)" "release"
XINCDIRS += \
$(EOLIST)
XCFLAGS += \
$(EOLIST)
XDEFINES += \
$(EOLIST)
XLFLAGS += \
$(EOLIST)
endif
#
# These are used by the link target if an NLM is being generated
# This is used by the link 'name' directive to name the nlm. If left blank
# TARGET_nlm (see below) will be used.
#
NLM_NAME = cach_socache
#
# This is used by the link '-desc ' directive.
# If left blank, NLM_NAME will be used.
#
NLM_DESCRIPTION = Apache $(VERSION_STR) Cache Socache Module
#
# This is used by the '-threadname' directive. If left blank,
# NLM_NAME Thread will be used.
#
NLM_THREAD_NAME = cach_socache
#
# If this is specified, it will override VERSION value in
# $(AP_WORK)/build/NWGNUenvironment.inc
#
NLM_VERSION =
#
# If this is specified, it will override the default of 64K
#
NLM_STACK_SIZE = 65536
#
# If this is specified it will be used by the link '-entry' directive
#
NLM_ENTRY_SYM =
#
# If this is specified it will be used by the link '-exit' directive
#
NLM_EXIT_SYM =
#
# If this is specified it will be used by the link '-check' directive
#
NLM_CHECK_SYM =
#
# If this is specified it will be used by the link '-flags' directive
#
NLM_FLAGS =
#
# If this is specified it will be linked in with the XDCData option in the def
# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled
# by setting APACHE_UNIPROC in the environment
#
XDCDATA =
#
# Declare all target files (you must add your files here)
#
#
# If there is an NLM target, put it here
#
TARGET_nlm = \
$(OBJDIR)/$(NLM_NAME).nlm \
$(EOLIST)
#
# If there is an LIB target, put it here
#
TARGET_lib = \
$(EOLIST)
#
# These are the OBJ files needed to create the NLM target above.
# Paths must all use the '/' character
#
FILES_nlm_objs = \
$(OBJDIR)/mod_cache_socache.o \
$(EOLIST)
#
# These are the LIB files needed to create the NLM target above.
# These will be added as a library command in the link.opt file.
#
FILES_nlm_libs = \
$(PRELUDE) \
$(EOLIST)
#
# These are the modules that the above NLM target depends on to load.
# These will be added as a module command in the link.opt file.
#
FILES_nlm_modules = \
Apache2 \
Libc \
mod_cach \
$(EOLIST)
#
# If the nlm has a msg file, put it's path here
#
FILE_nlm_msg =
#
# If the nlm has a hlp file put it's path here
#
FILE_nlm_hlp =
#
# If this is specified, it will override $(NWOS)\copyright.txt.
#
FILE_nlm_copyright =
#
# Any additional imports go here
#
FILES_nlm_Ximports = \
@libc.imp \
@aprlib.imp \
@httpd.imp \
@mod_cache.imp \
$(EOLIST)
#
# Any symbols exported to here
#
FILES_nlm_exports = \
cache_socache_module \
$(EOLIST)
#
# These are the OBJ files needed to create the LIB target above.
# Paths must all use the '/' character
#
FILES_lib_objs = \
$(EOLIST)
#
# implement targets and dependancies (leave this section alone)
#
libs :: $(OBJDIR) $(TARGET_lib)
nlms :: libs $(TARGET_nlm)
#
# Updated this target to create necessary directories and copy files to the
# correct place. (See $(AP_WORK)/build/NWGNUhead.inc for examples)
#
install :: nlms FORCE
#
# Any specialized rules here
#
#
# Include the 'tail' makefile that has targets that depend on variables defined
# in this makefile
#
include $(APBUILD)/NWGNUtail.inc

250
modules/cache/NWGNUmakefile vendored Normal file
View file

@ -0,0 +1,250 @@
#
# Declare the sub-directories to be built here
#
SUBDIRS = \
$(EOLIST)
#
# Get the 'head' of the build environment. This includes default targets and
# paths to tools
#
include $(AP_WORK)/build/NWGNUhead.inc
#
# build this level's files
#
# Make sure all needed macro's are defined
#
#
# These directories will be at the beginning of the include list, followed by
# INCDIRS
#
XINCDIRS += \
$(EOLIST)
#
# These flags will come after CFLAGS
#
XCFLAGS += \
$(EOLIST)
#
# These defines will come after DEFINES
#
XDEFINES += \
$(EOLIST)
#
# These flags will be added to the link.opt file
#
XLFLAGS += \
$(EOLIST)
#
# These values will be appended to the correct variables based on the value of
# RELEASE
#
ifeq "$(RELEASE)" "debug"
XINCDIRS += \
$(EOLIST)
XCFLAGS += \
$(EOLIST)
XDEFINES += \
$(EOLIST)
XLFLAGS += \
$(EOLIST)
endif
ifeq "$(RELEASE)" "noopt"
XINCDIRS += \
$(EOLIST)
XCFLAGS += \
$(EOLIST)
XDEFINES += \
$(EOLIST)
XLFLAGS += \
$(EOLIST)
endif
ifeq "$(RELEASE)" "release"
XINCDIRS += \
$(EOLIST)
XCFLAGS += \
$(EOLIST)
XDEFINES += \
$(EOLIST)
XLFLAGS += \
$(EOLIST)
endif
#
# These are used by the link target if an NLM is being generated
# This is used by the link 'name' directive to name the nlm. If left blank
# TARGET_nlm (see below) will be used.
#
NLM_NAME =
#
# This is used by the link '-desc ' directive.
# If left blank, NLM_NAME will be used.
#
NLM_DESCRIPTION =
#
# This is used by the '-threadname' directive. If left blank,
# NLM_NAME Thread will be used.
#
NLM_THREAD_NAME =
#
# If this is specified, it will override VERSION value in
# $(AP_WORK)/build/NWGNUenvironment.inc
#
NLM_VERSION =
#
# If this is specified, it will override the default of 64K
#
NLM_STACK_SIZE =
#
# If this is specified it will be used by the link '-entry' directive
#
NLM_ENTRY_SYM =
#
# If this is specified it will be used by the link '-exit' directive
#
NLM_EXIT_SYM =
#
# If this is specified it will be used by the link '-check' directive
#
NLM_CHECK_SYM =
#
# If these are specified it will be used by the link '-flags' directive
#
NLM_FLAGS =
#
# If this is specified it will be linked in with the XDCData option in the def
# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled
# by setting APACHE_UNIPROC in the environment
#
XDCDATA =
#
# If there is an NLM target, put it here
#
TARGET_nlm = \
$(OBJDIR)/mod_cach.nlm \
$(OBJDIR)/cach_dsk.nlm \
$(OBJDIR)/cach_socache.nlm \
$(OBJDIR)/socachdbm.nlm \
$(OBJDIR)/socachmem.nlm \
$(OBJDIR)/socachshmcb.nlm \
$(EOLIST)
#
# If there is an LIB target, put it here
#
TARGET_lib = \
$(EOLIST)
#
# These are the OBJ files needed to create the NLM target above.
# Paths must all use the '/' character
#
FILES_nlm_objs = \
$(EOLIST)
#
# These are the LIB files needed to create the NLM target above.
# These will be added as a library command in the link.opt file.
#
FILES_nlm_libs = \
$(EOLIST)
#
# These are the modules that the above NLM target depends on to load.
# These will be added as a module command in the link.opt file.
#
FILES_nlm_modules = \
$(EOLIST)
#
# If the nlm has a msg file, put it's path here
#
FILE_nlm_msg =
#
# If the nlm has a hlp file put it's path here
#
FILE_nlm_hlp =
#
# If this is specified, it will override $(NWOS)\copyright.txt.
#
FILE_nlm_copyright =
#
# Any additional imports go here
#
FILES_nlm_Ximports = \
$(EOLIST)
#
# Any symbols exported to here
#
FILES_nlm_exports = \
$(EOLIST)
#
# These are the OBJ files needed to create the LIB target above.
# Paths must all use the '/' character
#
FILES_lib_objs = \
$(EOLIST)
#
# implement targets and dependancies (leave this section alone)
#
libs :: $(OBJDIR) $(TARGET_lib)
nlms :: libs $(TARGET_nlm)
#
# Updated this target to create necessary directories and copy files to the
# correct place. (See $(AP_WORK)/build/NWGNUhead.inc for examples)
#
install :: nlms FORCE
$(call COPY,$(OBJDIR)/*.nlm, $(INSTALLBASE)/modules/)
#
# Any specialized rules here
#
#
# Include the 'tail' makefile that has targets that depend on variables defined
# in this makefile
#
include $(APBUILD)/NWGNUtail.inc

265
modules/cache/NWGNUmod_cach vendored Normal file
View file

@ -0,0 +1,265 @@
#
# Declare the sub-directories to be built here
#
SUBDIRS = \
$(EOLIST)
#
# Get the 'head' of the build environment. This includes default targets and
# paths to tools
#
include $(AP_WORK)/build/NWGNUhead.inc
#
# build this level's files
#
# Make sure all needed macro's are defined
#
#
# These directories will be at the beginning of the include list, followed by
# INCDIRS
#
XINCDIRS += \
$(APR)/include \
$(APRUTIL)/include \
$(AP_WORK)/include \
$(AP_WORK)/server/mpm/netware \
$(NWOS) \
$(EOLIST)
#
# These flags will come after CFLAGS
#
XCFLAGS += \
$(EOLIST)
#
# These defines will come after DEFINES
#
XDEFINES += \
$(EOLIST)
#
# These flags will be added to the link.opt file
#
XLFLAGS += \
$(EOLIST)
#
# These values will be appended to the correct variables based on the value of
# RELEASE
#
ifeq "$(RELEASE)" "debug"
XINCDIRS += \
$(EOLIST)
XCFLAGS += \
$(EOLIST)
XDEFINES += \
-DDEBUG \
$(EOLIST)
XLFLAGS += \
$(EOLIST)
endif
ifeq "$(RELEASE)" "noopt"
XINCDIRS += \
$(EOLIST)
XCFLAGS += \
$(EOLIST)
XDEFINES += \
$(EOLIST)
XLFLAGS += \
$(EOLIST)
endif
ifeq "$(RELEASE)" "release"
XINCDIRS += \
$(EOLIST)
XCFLAGS += \
$(EOLIST)
XDEFINES += \
$(EOLIST)
XLFLAGS += \
$(EOLIST)
endif
#
# These are used by the link target if an NLM is being generated
# This is used by the link 'name' directive to name the nlm. If left blank
# TARGET_nlm (see below) will be used.
#
NLM_NAME = mod_cach
#
# This is used by the link '-desc ' directive.
# If left blank, NLM_NAME will be used.
#
NLM_DESCRIPTION = Apache $(VERSION_STR) Cache module
#
# This is used by the '-threadname' directive. If left blank,
# NLM_NAME Thread will be used.
#
NLM_THREAD_NAME = mod_cach
#
# If this is specified, it will override VERSION value in
# $(AP_WORK)/build/NWGNUenvironment.inc
#
NLM_VERSION =
#
# If this is specified, it will override the default of 64K
#
NLM_STACK_SIZE = 65536
#
# If this is specified it will be used by the link '-entry' directive
#
NLM_ENTRY_SYM =
#
# If this is specified it will be used by the link '-exit' directive
#
NLM_EXIT_SYM =
#
# If this is specified it will be used by the link '-check' directive
#
NLM_CHECK_SYM =
#
# If this is specified it will be used by the link '-flags' directive
#
NLM_FLAGS =
#
# If this is specified it will be linked in with the XDCData option in the def
# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled
# by setting APACHE_UNIPROC in the environment
#
XDCDATA =
#
# Declare all target files (you must add your files here)
#
#
# If there is an NLM target, put it here
#
TARGET_nlm = \
$(OBJDIR)/mod_cach.nlm \
$(EOLIST)
#
# If there is an LIB target, put it here
#
TARGET_lib = \
$(EOLIST)
#
# These are the OBJ files needed to create the NLM target above.
# Paths must all use the '/' character
#
FILES_nlm_objs = \
$(OBJDIR)/cache_util.o \
$(OBJDIR)/cache_storage.o \
$(OBJDIR)/mod_cache.o \
$(EOLIST)
#
# These are the LIB files needed to create the NLM target above.
# These will be added as a library command in the link.opt file.
#
FILES_nlm_libs = \
$(PRELUDE) \
$(EOLIST)
#
# These are the modules that the above NLM target depends on to load.
# These will be added as a module command in the link.opt file.
#
FILES_nlm_modules = \
Apache2 \
Libc \
$(EOLIST)
#
# If the nlm has a msg file, put it's path here
#
FILE_nlm_msg =
#
# If the nlm has a hlp file put it's path here
#
FILE_nlm_hlp =
#
# If this is specified, it will override $(NWOS)\copyright.txt.
#
FILE_nlm_copyright =
#
# Any additional imports go here
#
FILES_nlm_Ximports = \
@libc.imp \
@aprlib.imp \
@httpd.imp \
@netware.imp \
$(EOLIST)
#
# Any symbols exported to here
#
FILES_nlm_exports = \
@mod_cache.imp \
cache_module \
$(EOLIST)
#
# These are the OBJ files needed to create the LIB target above.
# Paths must all use the '/' character
#
FILES_lib_objs = \
$(EOLIST)
#
# implement targets and dependancies (leave this section alone)
#
libs :: $(OBJDIR) $(TARGET_lib)
nlms :: libs $(TARGET_nlm)
#
# Updated this target to create necessary directories and copy files to the
# correct place. (See $(AP_WORK)/build/NWGNUhead.inc for examples)
#
install :: nlms FORCE
#
# Any specialized rules here
#
#
# Include the 'tail' makefile that has targets that depend on variables defined
# in this makefile
#
include $(APBUILD)/NWGNUtail.inc

261
modules/cache/NWGNUsocachdbm vendored Normal file
View file

@ -0,0 +1,261 @@
#
# Declare the sub-directories to be built here
#
SUBDIRS = \
$(EOLIST)
#
# Get the 'head' of the build environment. This includes default targets and
# paths to tools
#
include $(AP_WORK)/build/NWGNUhead.inc
#
# build this level's files
#
# Make sure all needed macro's are defined
#
#
# These directories will be at the beginning of the include list, followed by
# INCDIRS
#
XINCDIRS += \
$(APR)/include \
$(APRUTIL)/include \
$(AP_WORK)/include \
$(AP_WORK)/server/mpm/netware \
$(NWOS) \
$(STDMOD)/generators \
$(EOLIST)
#
# These flags will come after CFLAGS
#
XCFLAGS += \
$(EOLIST)
#
# These defines will come after DEFINES
#
XDEFINES += \
$(EOLIST)
#
# These flags will be added to the link.opt file
#
XLFLAGS += \
$(EOLIST)
#
# These values will be appended to the correct variables based on the value of
# RELEASE
#
ifeq "$(RELEASE)" "debug"
XINCDIRS += \
$(EOLIST)
XCFLAGS += \
$(EOLIST)
XDEFINES += \
$(EOLIST)
XLFLAGS += \
$(EOLIST)
endif
ifeq "$(RELEASE)" "noopt"
XINCDIRS += \
$(EOLIST)
XCFLAGS += \
$(EOLIST)
XDEFINES += \
$(EOLIST)
XLFLAGS += \
$(EOLIST)
endif
ifeq "$(RELEASE)" "release"
XINCDIRS += \
$(EOLIST)
XCFLAGS += \
$(EOLIST)
XDEFINES += \
$(EOLIST)
XLFLAGS += \
$(EOLIST)
endif
#
# These are used by the link target if an NLM is being generated
# This is used by the link 'name' directive to name the nlm. If left blank
# TARGET_nlm (see below) will be used.
#
NLM_NAME = socachedbm
#
# This is used by the link '-desc ' directive.
# If left blank, NLM_NAME will be used.
#
NLM_DESCRIPTION = Apache $(VERSION_STR) Socache DBM Module
#
# This is used by the '-threadname' directive. If left blank,
# NLM_NAME Thread will be used.
#
NLM_THREAD_NAME = socachedbm
#
# If this is specified, it will override VERSION value in
# $(AP_WORK)/build/NWGNUenvironment.inc
#
NLM_VERSION =
#
# If this is specified, it will override the default of 64K
#
NLM_STACK_SIZE = 65536
#
# If this is specified it will be used by the link '-entry' directive
#
NLM_ENTRY_SYM =
#
# If this is specified it will be used by the link '-exit' directive
#
NLM_EXIT_SYM =
#
# If this is specified it will be used by the link '-check' directive
#
NLM_CHECK_SYM =
#
# If this is specified it will be used by the link '-flags' directive
#
NLM_FLAGS =
#
# If this is specified it will be linked in with the XDCData option in the def
# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled
# by setting APACHE_UNIPROC in the environment
#
XDCDATA =
#
# Declare all target files (you must add your files here)
#
#
# If there is an NLM target, put it here
#
TARGET_nlm = \
$(OBJDIR)/$(NLM_NAME).nlm \
$(EOLIST)
#
# If there is an LIB target, put it here
#
TARGET_lib = \
$(EOLIST)
#
# These are the OBJ files needed to create the NLM target above.
# Paths must all use the '/' character
#
FILES_nlm_objs = \
$(OBJDIR)/mod_socache_dbm.o \
$(EOLIST)
#
# These are the LIB files needed to create the NLM target above.
# These will be added as a library command in the link.opt file.
#
FILES_nlm_libs = \
$(PRELUDE) \
$(EOLIST)
#
# These are the modules that the above NLM target depends on to load.
# These will be added as a module command in the link.opt file.
#
FILES_nlm_modules = \
Apache2 \
Libc \
$(EOLIST)
#
# If the nlm has a msg file, put it's path here
#
FILE_nlm_msg =
#
# If the nlm has a hlp file put it's path here
#
FILE_nlm_hlp =
#
# If this is specified, it will override $(NWOS)\copyright.txt.
#
FILE_nlm_copyright =
#
# Any additional imports go here
#
FILES_nlm_Ximports = \
@libc.imp \
@aprlib.imp \
@httpd.imp \
$(EOLIST)
#
# Any symbols exported to here
#
FILES_nlm_exports = \
socache_dbm_module \
$(EOLIST)
#
# These are the OBJ files needed to create the LIB target above.
# Paths must all use the '/' character
#
FILES_lib_objs = \
$(EOLIST)
#
# implement targets and dependancies (leave this section alone)
#
libs :: $(OBJDIR) $(TARGET_lib)
nlms :: libs $(TARGET_nlm)
#
# Updated this target to create necessary directories and copy files to the
# correct place. (See $(AP_WORK)/build/NWGNUhead.inc for examples)
#
install :: nlms FORCE
#
# Any specialized rules here
#
#
# Include the 'tail' makefile that has targets that depend on variables defined
# in this makefile
#
include $(APBUILD)/NWGNUtail.inc

261
modules/cache/NWGNUsocachmem vendored Normal file
View file

@ -0,0 +1,261 @@
#
# Declare the sub-directories to be built here
#
SUBDIRS = \
$(EOLIST)
#
# Get the 'head' of the build environment. This includes default targets and
# paths to tools
#
include $(AP_WORK)/build/NWGNUhead.inc
#
# build this level's files
#
# Make sure all needed macro's are defined
#
#
# These directories will be at the beginning of the include list, followed by
# INCDIRS
#
XINCDIRS += \
$(APR)/include \
$(APRUTIL)/include \
$(AP_WORK)/include \
$(STDMOD)/generators \
$(AP_WORK)/server/mpm/netware \
$(NWOS) \
$(EOLIST)
#
# These flags will come after CFLAGS
#
XCFLAGS += \
$(EOLIST)
#
# These defines will come after DEFINES
#
XDEFINES += \
$(EOLIST)
#
# These flags will be added to the link.opt file
#
XLFLAGS += \
$(EOLIST)
#
# These values will be appended to the correct variables based on the value of
# RELEASE
#
ifeq "$(RELEASE)" "debug"
XINCDIRS += \
$(EOLIST)
XCFLAGS += \
$(EOLIST)
XDEFINES += \
$(EOLIST)
XLFLAGS += \
$(EOLIST)
endif
ifeq "$(RELEASE)" "noopt"
XINCDIRS += \
$(EOLIST)
XCFLAGS += \
$(EOLIST)
XDEFINES += \
$(EOLIST)
XLFLAGS += \
$(EOLIST)
endif
ifeq "$(RELEASE)" "release"
XINCDIRS += \
$(EOLIST)
XCFLAGS += \
$(EOLIST)
XDEFINES += \
$(EOLIST)
XLFLAGS += \
$(EOLIST)
endif
#
# These are used by the link target if an NLM is being generated
# This is used by the link 'name' directive to name the nlm. If left blank
# TARGET_nlm (see below) will be used.
#
NLM_NAME = socachemem
#
# This is used by the link '-desc ' directive.
# If left blank, NLM_NAME will be used.
#
NLM_DESCRIPTION = Apache $(VERSION_STR) Socache Memory Module
#
# This is used by the '-threadname' directive. If left blank,
# NLM_NAME Thread will be used.
#
NLM_THREAD_NAME = socachemem
#
# If this is specified, it will override VERSION value in
# $(AP_WORK)/build/NWGNUenvironment.inc
#
NLM_VERSION =
#
# If this is specified, it will override the default of 64K
#
NLM_STACK_SIZE = 65536
#
# If this is specified it will be used by the link '-entry' directive
#
NLM_ENTRY_SYM =
#
# If this is specified it will be used by the link '-exit' directive
#
NLM_EXIT_SYM =
#
# If this is specified it will be used by the link '-check' directive
#
NLM_CHECK_SYM =
#
# If this is specified it will be used by the link '-flags' directive
#
NLM_FLAGS =
#
# If this is specified it will be linked in with the XDCData option in the def
# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled
# by setting APACHE_UNIPROC in the environment
#
XDCDATA =
#
# Declare all target files (you must add your files here)
#
#
# If there is an NLM target, put it here
#
TARGET_nlm = \
$(OBJDIR)/$(NLM_NAME).nlm \
$(EOLIST)
#
# If there is an LIB target, put it here
#
TARGET_lib = \
$(EOLIST)
#
# These are the OBJ files needed to create the NLM target above.
# Paths must all use the '/' character
#
FILES_nlm_objs = \
$(OBJDIR)/mod_socache_memcache.o \
$(EOLIST)
#
# These are the LIB files needed to create the NLM target above.
# These will be added as a library command in the link.opt file.
#
FILES_nlm_libs = \
$(PRELUDE) \
$(EOLIST)
#
# These are the modules that the above NLM target depends on to load.
# These will be added as a module command in the link.opt file.
#
FILES_nlm_modules = \
Apache2 \
Libc \
$(EOLIST)
#
# If the nlm has a msg file, put it's path here
#
FILE_nlm_msg =
#
# If the nlm has a hlp file put it's path here
#
FILE_nlm_hlp =
#
# If this is specified, it will override $(NWOS)\copyright.txt.
#
FILE_nlm_copyright =
#
# Any additional imports go here
#
FILES_nlm_Ximports = \
@libc.imp \
@aprlib.imp \
@httpd.imp \
$(EOLIST)
#
# Any symbols exported to here
#
FILES_nlm_exports = \
socache_memcache_module \
$(EOLIST)
#
# These are the OBJ files needed to create the LIB target above.
# Paths must all use the '/' character
#
FILES_lib_objs = \
$(EOLIST)
#
# implement targets and dependancies (leave this section alone)
#
libs :: $(OBJDIR) $(TARGET_lib)
nlms :: libs $(TARGET_nlm)
#
# Updated this target to create necessary directories and copy files to the
# correct place. (See $(AP_WORK)/build/NWGNUhead.inc for examples)
#
install :: nlms FORCE
#
# Any specialized rules here
#
#
# Include the 'tail' makefile that has targets that depend on variables defined
# in this makefile
#
include $(APBUILD)/NWGNUtail.inc

261
modules/cache/NWGNUsocachshmcb vendored Normal file
View file

@ -0,0 +1,261 @@
#
# Declare the sub-directories to be built here
#
SUBDIRS = \
$(EOLIST)
#
# Get the 'head' of the build environment. This includes default targets and
# paths to tools
#
include $(AP_WORK)/build/NWGNUhead.inc
#
# build this level's files
#
# Make sure all needed macro's are defined
#
#
# These directories will be at the beginning of the include list, followed by
# INCDIRS
#
XINCDIRS += \
$(APR)/include \
$(APRUTIL)/include \
$(AP_WORK)/include \
$(AP_WORK)/server/mpm/netware \
$(NWOS) \
$(STDMOD)/generators \
$(EOLIST)
#
# These flags will come after CFLAGS
#
XCFLAGS += \
$(EOLIST)
#
# These defines will come after DEFINES
#
XDEFINES += \
$(EOLIST)
#
# These flags will be added to the link.opt file
#
XLFLAGS += \
$(EOLIST)
#
# These values will be appended to the correct variables based on the value of
# RELEASE
#
ifeq "$(RELEASE)" "debug"
XINCDIRS += \
$(EOLIST)
XCFLAGS += \
$(EOLIST)
XDEFINES += \
$(EOLIST)
XLFLAGS += \
$(EOLIST)
endif
ifeq "$(RELEASE)" "noopt"
XINCDIRS += \
$(EOLIST)
XCFLAGS += \
$(EOLIST)
XDEFINES += \
$(EOLIST)
XLFLAGS += \
$(EOLIST)
endif
ifeq "$(RELEASE)" "release"
XINCDIRS += \
$(EOLIST)
XCFLAGS += \
$(EOLIST)
XDEFINES += \
$(EOLIST)
XLFLAGS += \
$(EOLIST)
endif
#
# These are used by the link target if an NLM is being generated
# This is used by the link 'name' directive to name the nlm. If left blank
# TARGET_nlm (see below) will be used.
#
NLM_NAME = socacheshmcb
#
# This is used by the link '-desc ' directive.
# If left blank, NLM_NAME will be used.
#
NLM_DESCRIPTION = Apache $(VERSION_STR) Socache DC Module
#
# This is used by the '-threadname' directive. If left blank,
# NLM_NAME Thread will be used.
#
NLM_THREAD_NAME = socacheshmcb
#
# If this is specified, it will override VERSION value in
# $(AP_WORK)/build/NWGNUenvironment.inc
#
NLM_VERSION =
#
# If this is specified, it will override the default of 64K
#
NLM_STACK_SIZE = 65536
#
# If this is specified it will be used by the link '-entry' directive
#
NLM_ENTRY_SYM =
#
# If this is specified it will be used by the link '-exit' directive
#
NLM_EXIT_SYM =
#
# If this is specified it will be used by the link '-check' directive
#
NLM_CHECK_SYM =
#
# If this is specified it will be used by the link '-flags' directive
#
NLM_FLAGS =
#
# If this is specified it will be linked in with the XDCData option in the def
# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled
# by setting APACHE_UNIPROC in the environment
#
XDCDATA =
#
# Declare all target files (you must add your files here)
#
#
# If there is an NLM target, put it here
#
TARGET_nlm = \
$(OBJDIR)/$(NLM_NAME).nlm \
$(EOLIST)
#
# If there is an LIB target, put it here
#
TARGET_lib = \
$(EOLIST)
#
# These are the OBJ files needed to create the NLM target above.
# Paths must all use the '/' character
#
FILES_nlm_objs = \
$(OBJDIR)/mod_socache_shmcb.o \
$(EOLIST)
#
# These are the LIB files needed to create the NLM target above.
# These will be added as a library command in the link.opt file.
#
FILES_nlm_libs = \
$(PRELUDE) \
$(EOLIST)
#
# These are the modules that the above NLM target depends on to load.
# These will be added as a module command in the link.opt file.
#
FILES_nlm_modules = \
Apache2 \
Libc \
$(EOLIST)
#
# If the nlm has a msg file, put it's path here
#
FILE_nlm_msg =
#
# If the nlm has a hlp file put it's path here
#
FILE_nlm_hlp =
#
# If this is specified, it will override $(NWOS)\copyright.txt.
#
FILE_nlm_copyright =
#
# Any additional imports go here
#
FILES_nlm_Ximports = \
@libc.imp \
@aprlib.imp \
@httpd.imp \
$(EOLIST)
#
# Any symbols exported to here
#
FILES_nlm_exports = \
socache_shmcb_module \
$(EOLIST)
#
# These are the OBJ files needed to create the LIB target above.
# Paths must all use the '/' character
#
FILES_lib_objs = \
$(EOLIST)
#
# implement targets and dependancies (leave this section alone)
#
libs :: $(OBJDIR) $(TARGET_lib)
nlms :: libs $(TARGET_nlm)
#
# Updated this target to create necessary directories and copy files to the
# correct place. (See $(AP_WORK)/build/NWGNUhead.inc for examples)
#
install :: nlms FORCE
#
# Any specialized rules here
#
#
# Include the 'tail' makefile that has targets that depend on variables defined
# in this makefile
#
include $(APBUILD)/NWGNUtail.inc

56
modules/cache/cache_common.h vendored Normal file
View file

@ -0,0 +1,56 @@
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file cache_common.h
* @brief Common Cache structs
*
* @defgroup Cache_cache Cache Functions
* @ingroup MOD_CACHE
* @{
*/
#ifndef CACHE_COMMON_H
#define CACHE_COMMON_H
/* a cache control header breakdown */
typedef struct cache_control {
unsigned int parsed:1;
unsigned int cache_control:1;
unsigned int pragma:1;
unsigned int no_cache:1;
unsigned int no_cache_header:1; /* no cache by header match */
unsigned int no_store:1;
unsigned int max_age:1;
unsigned int max_stale:1;
unsigned int min_fresh:1;
unsigned int no_transform:1;
unsigned int only_if_cached:1;
unsigned int public:1;
unsigned int private:1;
unsigned int private_header:1; /* private by header match */
unsigned int must_revalidate:1;
unsigned int proxy_revalidate:1;
unsigned int s_maxage:1;
unsigned int invalidated:1; /* has this entity been invalidated? */
apr_int64_t max_age_value; /* if positive, then set */
apr_int64_t max_stale_value; /* if positive, then set */
apr_int64_t min_fresh_value; /* if positive, then set */
apr_int64_t s_maxage_value; /* if positive, then set */
} cache_control_t;
#endif /* CACHE_COMMON_H */
/** @} */

68
modules/cache/cache_disk_common.h vendored Normal file
View file

@ -0,0 +1,68 @@
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file cache_disk_common.h
* @brief Common Disk Cache vars/structs
*
* @defgroup Cache_cache Cache Functions
* @ingroup MOD_DISK_CACHE
* @{
*/
#ifndef CACHE_DIST_COMMON_H
#define CACHE_DIST_COMMON_H
#define VARY_FORMAT_VERSION 5
#define DISK_FORMAT_VERSION 6
#define CACHE_HEADER_SUFFIX ".header"
#define CACHE_DATA_SUFFIX ".data"
#define CACHE_VDIR_SUFFIX ".vary"
#define AP_TEMPFILE_PREFIX "/"
#define AP_TEMPFILE_BASE "aptmp"
#define AP_TEMPFILE_SUFFIX "XXXXXX"
#define AP_TEMPFILE_BASELEN strlen(AP_TEMPFILE_BASE)
#define AP_TEMPFILE_NAMELEN strlen(AP_TEMPFILE_BASE AP_TEMPFILE_SUFFIX)
#define AP_TEMPFILE AP_TEMPFILE_PREFIX AP_TEMPFILE_BASE AP_TEMPFILE_SUFFIX
typedef struct {
/* Indicates the format of the header struct stored on-disk. */
apr_uint32_t format;
/* The HTTP status code returned for this response. */
int status;
/* The size of the entity name that follows. */
apr_size_t name_len;
/* The number of times we've cached this entity. */
apr_size_t entity_version;
/* Miscellaneous time values. */
apr_time_t date;
apr_time_t expire;
apr_time_t request_time;
apr_time_t response_time;
/* The ident of the body file, so we can test the body matches the header */
apr_ino_t inode;
apr_dev_t device;
/* Does this cached request have a body? */
unsigned int has_body:1;
unsigned int header_only:1;
/* The parsed cache control header */
cache_control_t control;
} disk_cache_info_t;
#endif /* CACHE_DIST_COMMON_H */
/** @} */

57
modules/cache/cache_socache_common.h vendored Normal file
View file

@ -0,0 +1,57 @@
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file cache_socache_common.h
* @brief Common Shared Object Cache vars/structs
*
* @defgroup Cache_cache Cache Functions
* @ingroup MOD_SOCACHE_CACHE
* @{
*/
#ifndef CACHE_SOCACHE_COMMON_H
#define CACHE_SOCACHE_COMMON_H
#include "apr_time.h"
#include "cache_common.h"
#define CACHE_SOCACHE_VARY_FORMAT_VERSION 1
#define CACHE_SOCACHE_DISK_FORMAT_VERSION 2
typedef struct {
/* Indicates the format of the header struct stored on-disk. */
apr_uint32_t format;
/* The HTTP status code returned for this response. */
int status;
/* The size of the entity name that follows. */
apr_size_t name_len;
/* The number of times we've cached this entity. */
apr_size_t entity_version;
/* Miscellaneous time values. */
apr_time_t date;
apr_time_t expire;
apr_time_t request_time;
apr_time_t response_time;
/* Does this cached request have a body? */
unsigned int header_only:1;
/* The parsed cache control header */
cache_control_t control;
} cache_socache_info_t;
#endif /* CACHE_SOCACHE_COMMON_H */
/** @} */

790
modules/cache/cache_storage.c vendored Normal file
View file

@ -0,0 +1,790 @@
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "mod_cache.h"
#include "cache_storage.h"
#include "cache_util.h"
APLOG_USE_MODULE(cache);
extern APR_OPTIONAL_FN_TYPE(ap_cache_generate_key) *cache_generate_key;
extern module AP_MODULE_DECLARE_DATA cache_module;
/* -------------------------------------------------------------- */
/*
* delete all URL entities from the cache
*
*/
int cache_remove_url(cache_request_rec *cache, request_rec *r)
{
cache_provider_list *list;
cache_handle_t *h;
list = cache->providers;
/* Remove the stale cache entry if present. If not, we're
* being called from outside of a request; remove the
* non-stale handle.
*/
h = cache->stale_handle ? cache->stale_handle : cache->handle;
if (!h) {
return OK;
}
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(00691)
"cache: Removing url %s from the cache", h->cache_obj->key);
/* for each specified cache type, delete the URL */
while (list) {
list->provider->remove_url(h, r);
list = list->next;
}
return OK;
}
/*
* create a new URL entity in the cache
*
* It is possible to store more than once entity per URL. This
* function will always create a new entity, regardless of whether
* other entities already exist for the same URL.
*
* The size of the entity is provided so that a cache module can
* decide whether or not it wants to cache this particular entity.
* If the size is unknown, a size of -1 should be set.
*/
int cache_create_entity(cache_request_rec *cache, request_rec *r,
apr_off_t size, apr_bucket_brigade *in)
{
cache_provider_list *list;
cache_handle_t *h = apr_pcalloc(r->pool, sizeof(cache_handle_t));
apr_status_t rv;
if (!cache) {
/* This should never happen */
ap_log_rerror(APLOG_MARK, APLOG_ERR, APR_EGENERAL, r, APLOGNO(00692)
"cache: No cache request information available for key"
" generation");
return APR_EGENERAL;
}
if (!cache->key) {
rv = cache_generate_key(r, r->pool, &cache->key);
if (rv != APR_SUCCESS) {
return rv;
}
}
list = cache->providers;
/* for each specified cache type, delete the URL */
while (list) {
switch (rv = list->provider->create_entity(h, r, cache->key, size, in)) {
case OK: {
cache->handle = h;
cache->provider = list->provider;
cache->provider_name = list->provider_name;
return OK;
}
case DECLINED: {
list = list->next;
continue;
}
default: {
return rv;
}
}
}
return DECLINED;
}
static int filter_header_do(void *v, const char *key, const char *val)
{
if ((*key == 'W' || *key == 'w') && !ap_cstr_casecmp(key, "Warning")
&& *val == '1') {
/* any stored Warning headers with warn-code 1xx (see section
* 14.46) MUST be deleted from the cache entry and the forwarded
* response.
*/
}
else {
apr_table_addn(v, key, val);
}
return 1;
}
static int remove_header_do(void *v, const char *key, const char *val)
{
if ((*key == 'W' || *key == 'w') && !ap_cstr_casecmp(key, "Warning")) {
/* any stored Warning headers with warn-code 2xx MUST be retained
* in the cache entry and the forwarded response.
*/
}
else {
apr_table_unset(v, key);
}
return 1;
}
static int add_header_do(void *v, const char *key, const char *val)
{
apr_table_addn(v, key, val);
return 1;
}
/**
* Take two sets of headers, sandwich them together, and apply the result to
* r->headers_out.
*
* To complicate this, a header may be duplicated in either table. Should a
* header exist in the top table, all matching headers will be removed from
* the bottom table before the headers are combined. The Warning headers are
* handled specially. Warnings are added rather than being replaced, while
* in the case of revalidation 1xx Warnings are stripped.
*
* The Content-Type and Last-Modified headers are then re-parsed and inserted
* into the request.
*/
void cache_accept_headers(cache_handle_t *h, request_rec *r, apr_table_t *top,
apr_table_t *bottom, int revalidation)
{
const char *v;
if (revalidation) {
r->headers_out = apr_table_make(r->pool, 10);
apr_table_do(filter_header_do, r->headers_out, bottom, NULL);
}
else if (r->headers_out != bottom) {
r->headers_out = apr_table_copy(r->pool, bottom);
}
apr_table_do(remove_header_do, r->headers_out, top, NULL);
apr_table_do(add_header_do, r->headers_out, top, NULL);
v = apr_table_get(r->headers_out, "Content-Type");
if (v) {
ap_set_content_type(r, v);
/*
* Also unset possible Content-Type headers in r->headers_out and
* r->err_headers_out as they may be different to what we have received
* from the cache.
* Actually they are not needed as r->content_type set by
* ap_set_content_type above will be used in the store_headers functions
* of the storage providers as a fallback and the HTTP_HEADER filter
* does overwrite the Content-Type header with r->content_type anyway.
*/
apr_table_unset(r->headers_out, "Content-Type");
apr_table_unset(r->err_headers_out, "Content-Type");
}
/* If the cache gave us a Last-Modified header, we can't just
* pass it on blindly because of restrictions on future values.
*/
v = apr_table_get(r->headers_out, "Last-Modified");
if (v) {
ap_update_mtime(r, apr_date_parse_http(v));
ap_set_last_modified(r);
}
}
/*
* select a specific URL entity in the cache
*
* It is possible to store more than one entity per URL. Content
* negotiation is used to select an entity. Once an entity is
* selected, details of it are stored in the per request
* config to save time when serving the request later.
*
* This function returns OK if successful, DECLINED if no
* cached entity fits the bill.
*/
int cache_select(cache_request_rec *cache, request_rec *r)
{
cache_provider_list *list;
apr_status_t rv;
cache_handle_t *h;
if (!cache) {
/* This should never happen */
ap_log_rerror(APLOG_MARK, APLOG_ERR, APR_EGENERAL, r, APLOGNO(00693)
"cache: No cache request information available for key"
" generation");
return DECLINED;
}
/* if no-cache, we can't serve from the cache, but we may store to the
* cache.
*/
if (!ap_cache_check_no_cache(cache, r)) {
return DECLINED;
}
if (!cache->key) {
rv = cache_generate_key(r, r->pool, &cache->key);
if (rv != APR_SUCCESS) {
return DECLINED;
}
}
/* go through the cache types till we get a match */
h = apr_palloc(r->pool, sizeof(cache_handle_t));
list = cache->providers;
while (list) {
switch ((rv = list->provider->open_entity(h, r, cache->key))) {
case OK: {
char *vary = NULL;
int mismatch = 0;
char *last = NULL;
if (list->provider->recall_headers(h, r) != APR_SUCCESS) {
/* try again with next cache type */
list = list->next;
continue;
}
/*
* Check Content-Negotiation - Vary
*
* At this point we need to make sure that the object we found in
* the cache is the same object that would be delivered to the
* client, when the effects of content negotiation are taken into
* effect.
*
* In plain english, we want to make sure that a language-negotiated
* document in one language is not given to a client asking for a
* language negotiated document in a different language by mistake.
*
* This code makes the assumption that the storage manager will
* cache the req_hdrs if the response contains a Vary header.
*
* RFC2616 13.6 and 14.44 describe the Vary mechanism.
*/
vary = cache_strqtok(
apr_pstrdup(r->pool,
cache_table_getm(r->pool, h->resp_hdrs, "Vary")),
CACHE_SEPARATOR, &last);
while (vary) {
const char *h1, *h2;
/*
* is this header in the request and the header in the cached
* request identical? If not, we give up and do a straight get
*/
h1 = cache_table_getm(r->pool, r->headers_in, vary);
h2 = cache_table_getm(r->pool, h->req_hdrs, vary);
if (h1 == h2) {
/* both headers NULL, so a match - do nothing */
}
else if (h1 && h2 && !strcmp(h1, h2)) {
/* both headers exist and are equal - do nothing */
}
else {
/* headers do not match, so Vary failed */
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS,
r, APLOGNO(00694) "cache_select(): Vary header mismatch.");
mismatch = 1;
break;
}
vary = cache_strqtok(NULL, CACHE_SEPARATOR, &last);
}
/* no vary match, try next provider */
if (mismatch) {
/* try again with next cache type */
list = list->next;
continue;
}
cache->provider = list->provider;
cache->provider_name = list->provider_name;
/*
* RFC2616 13.3.4 Rules for When to Use Entity Tags and Last-Modified
* Dates: An HTTP/1.1 caching proxy, upon receiving a conditional request
* that includes both a Last-Modified date and one or more entity tags as
* cache validators, MUST NOT return a locally cached response to the
* client unless that cached response is consistent with all of the
* conditional header fields in the request.
*/
if (ap_condition_if_match(r, h->resp_hdrs) == AP_CONDITION_NOMATCH
|| ap_condition_if_unmodified_since(r, h->resp_hdrs)
== AP_CONDITION_NOMATCH
|| ap_condition_if_none_match(r, h->resp_hdrs)
== AP_CONDITION_NOMATCH
|| ap_condition_if_modified_since(r, h->resp_hdrs)
== AP_CONDITION_NOMATCH
|| ap_condition_if_range(r, h->resp_hdrs) == AP_CONDITION_NOMATCH) {
mismatch = 1;
}
/* Is our cached response fresh enough? */
if (mismatch || !cache_check_freshness(h, cache, r)) {
const char *etag, *lastmod;
/* Cache-Control: only-if-cached and revalidation required, try
* the next provider
*/
if (cache->control_in.only_if_cached) {
/* try again with next cache type */
list = list->next;
continue;
}
/* set aside the stale entry for accessing later */
cache->stale_headers = apr_table_copy(r->pool,
r->headers_in);
cache->stale_handle = h;
/* if no existing conditionals, use conditionals of our own */
if (!mismatch) {
ap_log_rerror(
APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, r, APLOGNO(00695) "Cached response for %s isn't fresh. Adding "
"conditional request headers.", r->uri);
/* Remove existing conditionals that might conflict with ours */
apr_table_unset(r->headers_in, "If-Match");
apr_table_unset(r->headers_in, "If-Modified-Since");
apr_table_unset(r->headers_in, "If-None-Match");
apr_table_unset(r->headers_in, "If-Range");
apr_table_unset(r->headers_in, "If-Unmodified-Since");
etag = apr_table_get(h->resp_hdrs, "ETag");
lastmod = apr_table_get(h->resp_hdrs, "Last-Modified");
if (etag || lastmod) {
/* If we have a cached etag and/or Last-Modified add in
* our own conditionals.
*/
if (etag) {
apr_table_set(r->headers_in, "If-None-Match", etag);
}
if (lastmod) {
apr_table_set(r->headers_in, "If-Modified-Since",
lastmod);
}
/*
* Do not do Range requests with our own conditionals: If
* we get 304 the Range does not matter and otherwise the
* entity changed and we want to have the complete entity
*/
apr_table_unset(r->headers_in, "Range");
}
}
/* ready to revalidate, pretend we were never here */
return DECLINED;
}
/* Okay, this response looks okay. Merge in our stuff and go. */
cache_accept_headers(h, r, h->resp_hdrs, r->headers_out, 0);
cache->handle = h;
return OK;
}
case DECLINED: {
/* try again with next cache type */
list = list->next;
continue;
}
default: {
/* oo-er! an error */
return rv;
}
}
}
/* if Cache-Control: only-if-cached, and not cached, return 504 */
if (cache->control_in.only_if_cached) {
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, r, APLOGNO(00696)
"cache: 'only-if-cached' requested and no cached entity, "
"returning 504 Gateway Timeout for: %s", r->uri);
return HTTP_GATEWAY_TIME_OUT;
}
return DECLINED;
}
static apr_status_t cache_canonicalise_key(request_rec *r, apr_pool_t* p,
const char *path, const char *query,
apr_uri_t *parsed_uri,
const char **key)
{
cache_server_conf *conf;
char *port_str, *hn, *lcs;
const char *hostname, *scheme;
int i;
const char *kpath;
const char *kquery;
if (*key) {
/*
* We have been here before during the processing of this request.
*/
return APR_SUCCESS;
}
/*
* Get the module configuration. We need this for the CacheIgnoreQueryString
* option below.
*/
conf = (cache_server_conf *) ap_get_module_config(r->server->module_config,
&cache_module);
/*
* Use the canonical name to improve cache hit rate, but only if this is
* not a proxy request or if this is a reverse proxy request.
* We need to handle both cases in the same manner as for the reverse proxy
* case we have the following situation:
*
* If a cached entry is looked up by mod_cache's quick handler r->proxyreq
* is still unset in the reverse proxy case as it only gets set in the
* translate name hook (either by ProxyPass or mod_rewrite) which is run
* after the quick handler hook. This is different to the forward proxy
* case where it gets set before the quick handler is run (in the
* post_read_request hook).
* If a cache entry is created by the CACHE_SAVE filter we always have
* r->proxyreq set correctly.
* So we must ensure that in the reverse proxy case we use the same code
* path and using the canonical name seems to be the right thing to do
* in the reverse proxy case.
*/
if (!r->proxyreq || (r->proxyreq == PROXYREQ_REVERSE)) {
if (conf->base_uri && conf->base_uri->hostname) {
hostname = conf->base_uri->hostname;
}
else {
/* Use _default_ as the hostname if none present, as in mod_vhost */
hostname = ap_get_server_name(r);
if (!hostname) {
hostname = "_default_";
}
}
}
else if (parsed_uri->hostname) {
/* Copy the parsed uri hostname */
hn = apr_pstrdup(p, parsed_uri->hostname);
ap_str_tolower(hn);
/* const work-around */
hostname = hn;
}
else {
/* We are a proxied request, with no hostname. Unlikely
* to get very far - but just in case */
hostname = "_default_";
}
/*
* Copy the scheme, ensuring that it is lower case. If the parsed uri
* contains no string or if this is not a proxy request get the http
* scheme for this request. As r->parsed_uri.scheme is not set if this
* is a reverse proxy request, it is ensured that the cases
* "no proxy request" and "reverse proxy request" are handled in the same
* manner (see above why this is needed).
*/
if (r->proxyreq && parsed_uri->scheme) {
/* Copy the scheme and lower-case it */
lcs = apr_pstrdup(p, parsed_uri->scheme);
ap_str_tolower(lcs);
/* const work-around */
scheme = lcs;
}
else {
if (conf->base_uri && conf->base_uri->scheme) {
scheme = conf->base_uri->scheme;
}
else {
scheme = ap_http_scheme(r);
}
}
/*
* If this is a proxy request, but not a reverse proxy request (see comment
* above why these cases must be handled in the same manner), copy the
* URI's port-string (which may be a service name). If the URI contains
* no port-string, use apr-util's notion of the default port for that
* scheme - if available. Otherwise use the port-number of the current
* server.
*/
if (r->proxyreq && (r->proxyreq != PROXYREQ_REVERSE)) {
if (parsed_uri->port_str) {
port_str = apr_pcalloc(p, strlen(parsed_uri->port_str) + 2);
port_str[0] = ':';
for (i = 0; parsed_uri->port_str[i]; i++) {
port_str[i + 1] = apr_tolower(parsed_uri->port_str[i]);
}
}
else if (apr_uri_port_of_scheme(scheme)) {
port_str = apr_psprintf(p, ":%u", apr_uri_port_of_scheme(scheme));
}
else {
/* No port string given in the AbsoluteUri, and we have no
* idea what the default port for the scheme is. Leave it
* blank and live with the inefficiency of some extra cached
* entities.
*/
port_str = "";
}
}
else {
if (conf->base_uri && conf->base_uri->port_str) {
port_str = apr_pstrcat(p, ":", conf->base_uri->port_str, NULL);
}
else if (conf->base_uri && conf->base_uri->hostname) {
port_str = "";
}
else {
/* Use the server port */
port_str = apr_psprintf(p, ":%u", ap_get_server_port(r));
}
}
/*
* Check if we need to ignore session identifiers in the URL and do so
* if needed.
*/
kpath = path;
kquery = conf->ignorequerystring ? NULL : query;
if (conf->ignore_session_id->nelts) {
int i;
char **identifier;
identifier = (char **) conf->ignore_session_id->elts;
for (i = 0; i < conf->ignore_session_id->nelts; i++, identifier++) {
int len;
const char *param;
len = strlen(*identifier);
/*
* Check that we have a parameter separator in the last segment
* of the path and that the parameter matches our identifier
*/
if ((param = ap_strrchr_c(kpath, ';'))
&& !strncmp(param + 1, *identifier, len)
&& (*(param + len + 1) == '=')
&& !ap_strchr_c(param + len + 2, '/')) {
kpath = apr_pstrmemdup(p, kpath, param - kpath);
continue;
}
/*
* Check if the identifier is in the query string and cut it out.
*/
if (kquery && *kquery) {
/*
* First check if the identifier is at the beginning of the
* query string and followed by a '='
*/
if (!strncmp(kquery, *identifier, len) && kquery[len] == '=') {
param = kquery;
}
else {
char *complete;
/*
* In order to avoid subkey matching (PR 48401) prepend
* identifier with a '&' and append a '='
*/
complete = apr_pstrcat(p, "&", *identifier, "=", NULL);
param = ap_strstr_c(kquery, complete);
/* If we found something we are sitting on the '&' */
if (param) {
param++;
}
}
if (param) {
const char *amp;
char *dup = NULL;
if (kquery != param) {
dup = apr_pstrmemdup(p, kquery, param - kquery);
kquery = dup;
}
else {
kquery = "";
}
if ((amp = ap_strchr_c(param + len + 1, '&'))) {
kquery = apr_pstrcat(p, kquery, amp + 1, NULL);
}
else {
/*
* If query string is not "", then we have the case
* that the identifier parameter we removed was the
* last one in the original query string. Hence we have
* a trailing '&' which needs to be removed.
*/
if (dup) {
dup[strlen(dup) - 1] = '\0';
}
}
}
}
}
}
/* Key format is a URI, optionally without the query-string (NULL
* per above if conf->ignorequerystring)
*/
*key = apr_pstrcat(p, scheme, "://", hostname, port_str,
kpath, "?", kquery, NULL);
/*
* Store the key in the request_config for the cache as r->parsed_uri
* might have changed in the time from our first visit here triggered by the
* quick handler and our possible second visit triggered by the CACHE_SAVE
* filter (e.g. r->parsed_uri got unescaped). In this case we would save the
* resource in the cache under a key where it is never found by the quick
* handler during following requests.
*/
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, r, APLOGNO(00698)
"cache: Key for entity %s?%s is %s", path, query, *key);
return APR_SUCCESS;
}
apr_status_t cache_generate_key_default(request_rec *r, apr_pool_t* p,
const char **key)
{
/* In early processing (quick-handler, forward proxy), we want the initial
* query-string from r->parsed_uri, since any change before CACHE_SAVE
* shouldn't modify the key. Otherwise we want the actual query-string.
*/
const char *path = r->uri;
const char *query = r->args;
if (cache_use_early_url(r)) {
path = r->parsed_uri.path;
query = r->parsed_uri.query;
}
return cache_canonicalise_key(r, p, path, query, &r->parsed_uri, key);
}
/*
* Invalidate a specific URL entity in all caches
*
* All cached entities for this URL are removed, usually in
* response to a POST/PUT or DELETE.
*
* This function returns OK if at least one entity was found and
* removed, and DECLINED if no cached entities were removed.
*/
int cache_invalidate(cache_request_rec *cache, request_rec *r)
{
cache_provider_list *list;
apr_status_t rv, status = DECLINED;
cache_handle_t *h;
apr_uri_t location_uri;
apr_uri_t content_location_uri;
const char *location, *location_key = NULL;
const char *content_location, *content_location_key = NULL;
if (!cache) {
/* This should never happen */
ap_log_rerror(
APLOG_MARK, APLOG_ERR, APR_EGENERAL, r, APLOGNO(00697) "cache: No cache request information available for key"
" generation");
return DECLINED;
}
if (!cache->key) {
rv = cache_generate_key(r, r->pool, &cache->key);
if (rv != APR_SUCCESS) {
return DECLINED;
}
}
location = apr_table_get(r->headers_out, "Location");
if (location) {
if (apr_uri_parse(r->pool, location, &location_uri)
|| cache_canonicalise_key(r, r->pool,
location_uri.path,
location_uri.query,
&location_uri, &location_key)
|| !(r->parsed_uri.hostname
&& location_uri.hostname
&& !strcmp(r->parsed_uri.hostname,
location_uri.hostname))) {
location_key = NULL;
}
}
content_location = apr_table_get(r->headers_out, "Content-Location");
if (content_location) {
if (apr_uri_parse(r->pool, content_location,
&content_location_uri)
|| cache_canonicalise_key(r, r->pool,
content_location_uri.path,
content_location_uri.query,
&content_location_uri,
&content_location_key)
|| !(r->parsed_uri.hostname
&& content_location_uri.hostname
&& !strcmp(r->parsed_uri.hostname,
content_location_uri.hostname))) {
content_location_key = NULL;
}
}
/* go through the cache types */
h = apr_palloc(r->pool, sizeof(cache_handle_t));
list = cache->providers;
while (list) {
/* invalidate the request uri */
rv = list->provider->open_entity(h, r, cache->key);
if (OK == rv) {
rv = list->provider->invalidate_entity(h, r);
status = OK;
}
ap_log_rerror(
APLOG_MARK, APLOG_DEBUG, rv, r, APLOGNO(02468) "cache: Attempted to invalidate cached entity with key: %s", cache->key);
/* invalidate the Location */
if (location_key) {
rv = list->provider->open_entity(h, r, location_key);
if (OK == rv) {
rv = list->provider->invalidate_entity(h, r);
status = OK;
}
ap_log_rerror(
APLOG_MARK, APLOG_DEBUG, rv, r, APLOGNO(02469) "cache: Attempted to invalidate cached entity with key: %s", location_key);
}
/* invalidate the Content-Location */
if (content_location_key) {
rv = list->provider->open_entity(h, r, content_location_key);
if (OK == rv) {
rv = list->provider->invalidate_entity(h, r);
status = OK;
}
ap_log_rerror(
APLOG_MARK, APLOG_DEBUG, rv, r, APLOGNO(02470) "cache: Attempted to invalidate cached entity with key: %s", content_location_key);
}
list = list->next;
}
return status;
}

76
modules/cache/cache_storage.h vendored Normal file
View file

@ -0,0 +1,76 @@
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file cache_storage.h
* @brief Cache Storage Functions
*
* @defgroup Cache_storage Cache Storage Functions
* @ingroup MOD_CACHE
* @{
*/
#ifndef CACHE_STORAGE_H
#define CACHE_STORAGE_H
#ifdef __cplusplus
extern "C" {
#endif
#include "mod_cache.h"
#include "cache_util.h"
/**
* cache_storage.c
*/
int cache_remove_url(cache_request_rec *cache, request_rec *r);
int cache_create_entity(cache_request_rec *cache, request_rec *r,
apr_off_t size, apr_bucket_brigade *in);
int cache_select(cache_request_rec *cache, request_rec *r);
/**
* invalidate a specific URL entity in all caches
*
* All cached entities for this URL are removed, usually in
* response to a POST/PUT or DELETE.
*
* This function returns OK if at least one entity was found and
* removed, and DECLINED if no cached entities were removed.
* @param cache cache_request_rec
* @param r request_rec
*/
int cache_invalidate(cache_request_rec *cache, request_rec *r);
apr_status_t cache_generate_key_default(request_rec *r, apr_pool_t* p,
const char **key);
/**
* Merge in cached headers into the response
* @param h cache_handle_t
* @param r request_rec
* @param top headers to be applied
* @param bottom headers to be overwritten
* @param revalidation true if revalidation is taking place
*/
void cache_accept_headers(cache_handle_t *h, request_rec *r, apr_table_t *top,
apr_table_t *bottom, int revalidation);
#ifdef __cplusplus
}
#endif
#endif /* !CACHE_STORAGE_H */
/** @} */

1344
modules/cache/cache_util.c vendored Normal file

File diff suppressed because it is too large Load diff

341
modules/cache/cache_util.h vendored Normal file
View file

@ -0,0 +1,341 @@
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file cache_util.h
* @brief Cache Storage Functions
*
* @defgroup Cache_util Cache Utility Functions
* @ingroup MOD_CACHE
* @{
*/
#ifndef CACHE_UTIL_H
#define CACHE_UTIL_H
#ifdef __cplusplus
extern "C" {
#endif
#include "mod_cache.h"
#include "apr_hooks.h"
#include "apr.h"
#include "apr_lib.h"
#include "apr_strings.h"
#include "apr_buckets.h"
#include "apr_md5.h"
#include "apr_pools.h"
#include "apr_strings.h"
#include "apr_optional.h"
#define APR_WANT_STRFUNC
#include "apr_want.h"
#include "httpd.h"
#include "http_config.h"
#include "ap_config.h"
#include "http_core.h"
#include "http_protocol.h"
#include "http_request.h"
#include "http_vhost.h"
#include "http_main.h"
#include "http_log.h"
#include "http_connection.h"
#include "util_filter.h"
#include "apr_uri.h"
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#include "apr_atomic.h"
#ifndef MAX
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#endif
#ifndef MIN
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
#define MSEC_ONE_DAY ((apr_time_t)(86400*APR_USEC_PER_SEC)) /* one day, in microseconds */
#define MSEC_ONE_HR ((apr_time_t)(3600*APR_USEC_PER_SEC)) /* one hour, in microseconds */
#define MSEC_ONE_MIN ((apr_time_t)(60*APR_USEC_PER_SEC)) /* one minute, in microseconds */
#define MSEC_ONE_SEC ((apr_time_t)(APR_USEC_PER_SEC)) /* one second, in microseconds */
#define DEFAULT_CACHE_MAXEXPIRE MSEC_ONE_DAY
#define DEFAULT_CACHE_MINEXPIRE 0
#define DEFAULT_CACHE_EXPIRE MSEC_ONE_HR
#define DEFAULT_CACHE_LMFACTOR (0.1)
#define DEFAULT_CACHE_MAXAGE 5
#define DEFAULT_X_CACHE 0
#define DEFAULT_X_CACHE_DETAIL 0
#define DEFAULT_CACHE_STALE_ON_ERROR 1
#define DEFAULT_CACHE_LOCKPATH "/mod_cache-lock"
#define CACHE_LOCKNAME_KEY "mod_cache-lockname"
#define CACHE_LOCKFILE_KEY "mod_cache-lockfile"
#define CACHE_CTX_KEY "mod_cache-ctx"
#define CACHE_SEPARATOR ", \t"
/**
* cache_util.c
*/
struct cache_enable {
apr_uri_t url;
const char *type;
apr_size_t pathlen;
};
struct cache_disable {
apr_uri_t url;
apr_size_t pathlen;
};
/* static information about the local cache */
typedef struct {
apr_array_header_t *cacheenable; /* URLs to cache */
apr_array_header_t *cachedisable; /* URLs not to cache */
/** store the headers that should not be stored in the cache */
apr_array_header_t *ignore_headers;
/** store the identifiers that should not be used for key calculation */
apr_array_header_t *ignore_session_id;
const char *lockpath;
apr_time_t lockmaxage;
apr_uri_t *base_uri;
/** ignore client's requests for uncached responses */
unsigned int ignorecachecontrol:1;
/** ignore query-string when caching */
unsigned int ignorequerystring:1;
/** run within the quick handler */
unsigned int quick:1;
/* thundering herd lock */
unsigned int lock:1;
unsigned int x_cache:1;
unsigned int x_cache_detail:1;
/* flag if CacheIgnoreHeader has been set */
#define CACHE_IGNORE_HEADERS_SET 1
#define CACHE_IGNORE_HEADERS_UNSET 0
unsigned int ignore_headers_set:1;
/* flag if CacheIgnoreURLSessionIdentifiers has been set */
#define CACHE_IGNORE_SESSION_ID_SET 1
#define CACHE_IGNORE_SESSION_ID_UNSET 0
unsigned int ignore_session_id_set:1;
unsigned int base_uri_set:1;
unsigned int ignorecachecontrol_set:1;
unsigned int ignorequerystring_set:1;
unsigned int quick_set:1;
unsigned int lock_set:1;
unsigned int lockpath_set:1;
unsigned int lockmaxage_set:1;
unsigned int x_cache_set:1;
unsigned int x_cache_detail_set:1;
} cache_server_conf;
typedef struct {
/* Minimum time to keep cached files in msecs */
apr_time_t minex;
/* Maximum time to keep cached files in msecs */
apr_time_t maxex;
/* default time to keep cached file in msecs */
apr_time_t defex;
/* factor for estimating expires date */
double factor;
/* cache enabled for this location */
apr_array_header_t *cacheenable;
/* cache disabled for this location */
unsigned int disable:1;
/* set X-Cache headers */
unsigned int x_cache:1;
unsigned int x_cache_detail:1;
/* serve stale on error */
unsigned int stale_on_error:1;
/** ignore the last-modified header when deciding to cache this request */
unsigned int no_last_mod_ignore:1;
/** ignore expiration date from server */
unsigned int store_expired:1;
/** ignore Cache-Control: private header from server */
unsigned int store_private:1;
/** ignore Cache-Control: no-store header from client or server */
unsigned int store_nostore:1;
unsigned int minex_set:1;
unsigned int maxex_set:1;
unsigned int defex_set:1;
unsigned int factor_set:1;
unsigned int x_cache_set:1;
unsigned int x_cache_detail_set:1;
unsigned int stale_on_error_set:1;
unsigned int no_last_mod_ignore_set:1;
unsigned int store_expired_set:1;
unsigned int store_private_set:1;
unsigned int store_nostore_set:1;
unsigned int enable_set:1;
unsigned int disable_set:1;
} cache_dir_conf;
/* A linked-list of authn providers. */
typedef struct cache_provider_list cache_provider_list;
struct cache_provider_list {
const char *provider_name;
const cache_provider *provider;
cache_provider_list *next;
};
/* per request cache information */
typedef struct {
cache_provider_list *providers; /* possible cache providers */
const cache_provider *provider; /* current cache provider */
const char *provider_name; /* current cache provider name */
int fresh; /* is the entity fresh? */
cache_handle_t *handle; /* current cache handle */
cache_handle_t *stale_handle; /* stale cache handle */
apr_table_t *stale_headers; /* original request headers. */
int in_checked; /* CACHE_SAVE must cache the entity */
int block_response; /* CACHE_SAVE must block response. */
apr_bucket_brigade *saved_brigade; /* copy of partial response */
apr_off_t saved_size; /* length of saved_brigade */
apr_time_t exp; /* expiration */
apr_time_t lastmod; /* last-modified time */
cache_info *info; /* current cache info */
ap_filter_t *save_filter; /* Enable us to restore the filter on error */
ap_filter_t *remove_url_filter; /* Enable us to remove the filter */
const char *key; /* The cache key created for this
* request
*/
apr_off_t size; /* the content length from the headers, or -1 */
apr_bucket_brigade *out; /* brigade to reuse for upstream responses */
cache_control_t control_in; /* cache control incoming */
} cache_request_rec;
/**
* Check the whether the request allows a cached object to be served as per RFC2616
* section 14.9.4 (Cache Revalidation and Reload Controls)
* @param cache cache_request_rec
* @param r request_rec
* @return 0 ==> cache object may not be served, 1 ==> cache object may be served
*/
int ap_cache_check_no_cache(cache_request_rec *cache, request_rec *r);
/**
* Check the whether the request allows a cached object to be stored as per RFC2616
* section 14.9.2 (What May be Stored by Caches)
* @param cache cache_request_rec
* @param r request_rec
* @return 0 ==> cache object may not be served, 1 ==> cache object may be served
*/
int ap_cache_check_no_store(cache_request_rec *cache, request_rec *r);
/**
* Check the freshness of the cache object per RFC2616 section 13.2 (Expiration Model)
* @param h cache_handle_t
* @param cache cache_request_rec
* @param r request_rec
* @return 0 ==> cache object is stale, 1 ==> cache object is fresh
*/
int cache_check_freshness(cache_handle_t *h, cache_request_rec *cache,
request_rec *r);
/**
* Try obtain a cache wide lock on the given cache key.
*
* If we return APR_SUCCESS, we obtained the lock, and we are clear to
* proceed to the backend. If we return APR_EEXISTS, then the lock is
* already locked, someone else has gone to refresh the backend data
* already, so we must return stale data with a warning in the mean
* time. If we return anything else, then something has gone pear
* shaped, and we allow the request through to the backend regardless.
*
* This lock is created from the request pool, meaning that should
* something go wrong and the lock isn't deleted on return of the
* request headers from the backend for whatever reason, at worst the
* lock will be cleaned up when the request is dies or finishes.
*
* If something goes truly bananas and the lock isn't deleted when the
* request dies, the lock will be trashed when its max-age is reached,
* or when a request arrives containing a Cache-Control: no-cache. At
* no point is it possible for this lock to permanently deny access to
* the backend.
*/
apr_status_t cache_try_lock(cache_server_conf *conf, cache_request_rec *cache,
request_rec *r);
/**
* Remove the cache lock, if present.
*
* First, try to close the file handle, whose delete-on-close should
* kill the file. Otherwise, just delete the file by name.
*
* If no lock name has yet been calculated, do the calculation of the
* lock name first before trying to delete the file.
*
* If an optional bucket brigade is passed, the lock will only be
* removed if the bucket brigade contains an EOS bucket.
*/
apr_status_t cache_remove_lock(cache_server_conf *conf,
cache_request_rec *cache, request_rec *r, apr_bucket_brigade *bb);
cache_provider_list *cache_get_providers(request_rec *r,
cache_server_conf *conf);
/**
* Get a value from a table, where the table may contain multiple
* values for a given key.
*
* When the table contains a single value, that value is returned
* unchanged.
*
* When the table contains two or more values for a key, all values
* for the key are returned, separated by commas.
*/
const char *cache_table_getm(apr_pool_t *p, const apr_table_t *t,
const char *key);
/**
* String tokenizer that ignores separator characters within quoted strings
* and escaped characters, as per RFC2616 section 2.2.
*/
char *cache_strqtok(char *str, const char *sep, char **last);
/**
* Merge err_headers_out into headers_out and add request's Content-Type and
* Content-Encoding if available.
*/
apr_table_t *cache_merge_headers_out(request_rec *r);
/**
* Return whether to use request's path/query from early stage (r->parsed_uri)
* or the current/rewritable ones (r->uri/r->args).
*/
int cache_use_early_url(request_rec *r);
#ifdef __cplusplus
}
#endif
#endif /* !CACHE_UTIL_H */
/** @} */

143
modules/cache/config.m4 vendored Normal file
View file

@ -0,0 +1,143 @@
dnl modules enabled in this directory by default
dnl APACHE_MODULE(name, helptext[, objects[, structname[, default[, config]]]])
APACHE_MODPATH_INIT(cache)
APACHE_MODULE(file_cache, File cache, , , most)
dnl # list of object files for mod_cache
cache_objs="dnl
mod_cache.lo dnl
cache_storage.lo dnl
cache_util.lo dnl
"
cache_disk_objs="mod_cache_disk.lo"
cache_socache_objs="mod_cache_socache.lo"
case "$host" in
*os2*)
# OS/2 DLLs must resolve all symbols at build time
# and we need some from main cache module
cache_disk_objs="$cache_disk_objs mod_cache.la"
cache_socache_objs="$cache_socache_objs mod_cache.la"
;;
esac
APACHE_MODULE(cache, dynamic file caching. At least one storage management module (e.g. mod_cache_disk) is also necessary., $cache_objs, , most)
APACHE_MODULE(cache_disk, disk caching module, $cache_disk_objs, , most, , cache)
APACHE_MODULE(cache_socache, shared object caching module, $cache_socache_objs, , most)
dnl
dnl APACHE_CHECK_DISTCACHE
dnl
dnl Configure for the detected distcache installation, giving
dnl preference to "--with-distcache=<path>" if it was specified.
dnl
AC_DEFUN([APACHE_CHECK_DISTCACHE],[
if test "x$ap_distcache_configured" = "x"; then
dnl initialise the variables we use
ap_distcache_found=""
ap_distcache_base=""
ap_distcache_libs=""
ap_distcache_ldflags=""
ap_distcache_with=""
dnl Determine the distcache base directory, if any
AC_MSG_CHECKING([for user-provided distcache base])
AC_ARG_WITH(distcache, APACHE_HELP_STRING(--with-distcache=PATH, Distcache installation directory), [
dnl If --with-distcache specifies a directory, we use that directory or fail
if test "x$withval" != "xyes" -a "x$withval" != "x"; then
dnl This ensures $withval is actually a directory and that it is absolute
ap_distcache_with="yes"
ap_distcache_base="`cd $withval ; pwd`"
fi
])
if test "x$ap_distcache_base" = "x"; then
AC_MSG_RESULT(none)
else
AC_MSG_RESULT($ap_distcache_base)
fi
dnl Run header and version checks
saved_CPPFLAGS="$CPPFLAGS"
saved_LIBS="$LIBS"
saved_LDFLAGS="$LDFLAGS"
if test "x$ap_distcache_base" != "x"; then
APR_ADDTO(CPPFLAGS, [-I$ap_distcache_base/include])
APR_ADDTO(MOD_INCLUDES, [-I$ap_distcache_base/include])
APR_ADDTO(LDFLAGS, [-L$ap_distcache_base/lib])
APR_ADDTO(ap_distcache_ldflags, [-L$ap_distcache_base/lib])
if test "x$ap_platform_runtime_link_flag" != "x"; then
APR_ADDTO(LDFLAGS, [$ap_platform_runtime_link_flag$ap_distcache_base/lib])
APR_ADDTO(ap_distcache_ldflags, [$ap_platform_runtime_link_flag$ap_distcache_base/lib])
fi
fi
dnl First check for mandatory headers
AC_CHECK_HEADERS([distcache/dc_client.h], [ap_distcache_found="yes"], [])
if test "$ap_distcache_found" = "yes"; then
dnl test for a good version
AC_MSG_CHECKING(for distcache version)
AC_TRY_COMPILE([#include <distcache/dc_client.h>],[
#if DISTCACHE_CLIENT_API != 0x0001
#error "distcache API version is unrecognised"
#endif],
[],
[ap_distcache_found="no"])
AC_MSG_RESULT($ap_distcache_found)
fi
if test "$ap_distcache_found" != "yes"; then
if test "x$ap_distcache_with" = "x"; then
AC_MSG_WARN([...No distcache detected])
else
AC_MSG_ERROR([...No distcache detected])
fi
else
dnl Run library and function checks
AC_MSG_CHECKING(for distcache libraries)
ap_distcache_libs="-ldistcache -lnal"
APR_ADDTO(LIBS, [$ap_distcache_libs])
AC_TRY_LINK(
[#include <distcache/dc_client.h>],
[DC_CTX *foo = DC_CTX_new((const char *)0,0);],
[],
[ap_distcache_found="no"])
AC_MSG_RESULT($ap_distcache_found)
if test "$ap_distcache_found" != "yes"; then
if test "x$ap_distcache_base" = "x"; then
AC_MSG_WARN([... Error, distcache libraries were missing or unusable])
else
AC_MSG_ERROR([... Error, distcache libraries were missing or unusable])
fi
fi
fi
dnl restore
CPPFLAGS="$saved_CPPFLAGS"
LIBS="$saved_LIBS"
LDFLAGS="$saved_LDFLAGS"
dnl Adjust apache's configuration based on what we found above.
if test "$ap_distcache_found" = "yes"; then
APR_ADDTO(MOD_SOCACHE_DC_LDADD, [$ap_distcache_ldflags $ap_distcache_libs])
AC_DEFINE(HAVE_DISTCACHE, 1, [Define if distcache support is enabled])
else
enable_socache_dc=no
fi
ap_distcache_configured="yes"
fi
])
APACHE_MODULE(socache_shmcb, shmcb small object cache provider, , , most)
APACHE_MODULE(socache_dbm, dbm small object cache provider, , , most)
APACHE_MODULE(socache_memcache, memcache small object cache provider, , , most)
APACHE_MODULE(socache_redis, redis small object cache provider, , , most)
APACHE_MODULE(socache_dc, distcache small object cache provider, , , no, [
APACHE_CHECK_DISTCACHE
])
APR_ADDTO(INCLUDES, [-I\$(top_srcdir)/$modpath_current])
APACHE_MODPATH_FINISH

2717
modules/cache/mod_cache.c vendored Normal file

File diff suppressed because it is too large Load diff

194
modules/cache/mod_cache.dep vendored Normal file
View file

@ -0,0 +1,194 @@
# Microsoft Developer Studio Generated Dependency File, included by mod_cache.mak
.\cache_storage.c : \
"..\..\include\ap_config.h"\
"..\..\include\ap_config_layout.h"\
"..\..\include\ap_expr.h"\
"..\..\include\ap_hooks.h"\
"..\..\include\ap_mmn.h"\
"..\..\include\ap_regex.h"\
"..\..\include\ap_release.h"\
"..\..\include\apache_noprobes.h"\
"..\..\include\http_config.h"\
"..\..\include\http_connection.h"\
"..\..\include\http_core.h"\
"..\..\include\http_log.h"\
"..\..\include\http_main.h"\
"..\..\include\http_protocol.h"\
"..\..\include\http_request.h"\
"..\..\include\http_vhost.h"\
"..\..\include\httpd.h"\
"..\..\include\os.h"\
"..\..\include\util_cfgtree.h"\
"..\..\include\util_filter.h"\
"..\..\srclib\apr-util\include\apr_buckets.h"\
"..\..\srclib\apr-util\include\apr_date.h"\
"..\..\srclib\apr-util\include\apr_hooks.h"\
"..\..\srclib\apr-util\include\apr_md5.h"\
"..\..\srclib\apr-util\include\apr_optional.h"\
"..\..\srclib\apr-util\include\apr_optional_hooks.h"\
"..\..\srclib\apr-util\include\apr_uri.h"\
"..\..\srclib\apr-util\include\apr_xlate.h"\
"..\..\srclib\apr-util\include\apu.h"\
"..\..\srclib\apr\include\apr.h"\
"..\..\srclib\apr\include\apr_allocator.h"\
"..\..\srclib\apr\include\apr_atomic.h"\
"..\..\srclib\apr\include\apr_dso.h"\
"..\..\srclib\apr\include\apr_errno.h"\
"..\..\srclib\apr\include\apr_file_info.h"\
"..\..\srclib\apr\include\apr_file_io.h"\
"..\..\srclib\apr\include\apr_general.h"\
"..\..\srclib\apr\include\apr_global_mutex.h"\
"..\..\srclib\apr\include\apr_hash.h"\
"..\..\srclib\apr\include\apr_inherit.h"\
"..\..\srclib\apr\include\apr_lib.h"\
"..\..\srclib\apr\include\apr_mmap.h"\
"..\..\srclib\apr\include\apr_network_io.h"\
"..\..\srclib\apr\include\apr_poll.h"\
"..\..\srclib\apr\include\apr_pools.h"\
"..\..\srclib\apr\include\apr_portable.h"\
"..\..\srclib\apr\include\apr_proc_mutex.h"\
"..\..\srclib\apr\include\apr_ring.h"\
"..\..\srclib\apr\include\apr_shm.h"\
"..\..\srclib\apr\include\apr_strings.h"\
"..\..\srclib\apr\include\apr_tables.h"\
"..\..\srclib\apr\include\apr_thread_mutex.h"\
"..\..\srclib\apr\include\apr_thread_proc.h"\
"..\..\srclib\apr\include\apr_time.h"\
"..\..\srclib\apr\include\apr_user.h"\
"..\..\srclib\apr\include\apr_want.h"\
".\cache_common.h"\
".\cache_storage.h"\
".\cache_util.h"\
".\mod_cache.h"\
.\cache_util.c : \
"..\..\include\ap_config.h"\
"..\..\include\ap_config_layout.h"\
"..\..\include\ap_expr.h"\
"..\..\include\ap_hooks.h"\
"..\..\include\ap_mmn.h"\
"..\..\include\ap_provider.h"\
"..\..\include\ap_regex.h"\
"..\..\include\ap_release.h"\
"..\..\include\apache_noprobes.h"\
"..\..\include\http_config.h"\
"..\..\include\http_connection.h"\
"..\..\include\http_core.h"\
"..\..\include\http_log.h"\
"..\..\include\http_main.h"\
"..\..\include\http_protocol.h"\
"..\..\include\http_request.h"\
"..\..\include\http_vhost.h"\
"..\..\include\httpd.h"\
"..\..\include\os.h"\
"..\..\include\util_cfgtree.h"\
"..\..\include\util_filter.h"\
"..\..\srclib\apr-util\include\apr_buckets.h"\
"..\..\srclib\apr-util\include\apr_date.h"\
"..\..\srclib\apr-util\include\apr_hooks.h"\
"..\..\srclib\apr-util\include\apr_md5.h"\
"..\..\srclib\apr-util\include\apr_optional.h"\
"..\..\srclib\apr-util\include\apr_optional_hooks.h"\
"..\..\srclib\apr-util\include\apr_uri.h"\
"..\..\srclib\apr-util\include\apr_xlate.h"\
"..\..\srclib\apr-util\include\apu.h"\
"..\..\srclib\apr\include\apr.h"\
"..\..\srclib\apr\include\apr_allocator.h"\
"..\..\srclib\apr\include\apr_atomic.h"\
"..\..\srclib\apr\include\apr_dso.h"\
"..\..\srclib\apr\include\apr_errno.h"\
"..\..\srclib\apr\include\apr_file_info.h"\
"..\..\srclib\apr\include\apr_file_io.h"\
"..\..\srclib\apr\include\apr_general.h"\
"..\..\srclib\apr\include\apr_global_mutex.h"\
"..\..\srclib\apr\include\apr_hash.h"\
"..\..\srclib\apr\include\apr_inherit.h"\
"..\..\srclib\apr\include\apr_lib.h"\
"..\..\srclib\apr\include\apr_mmap.h"\
"..\..\srclib\apr\include\apr_network_io.h"\
"..\..\srclib\apr\include\apr_poll.h"\
"..\..\srclib\apr\include\apr_pools.h"\
"..\..\srclib\apr\include\apr_portable.h"\
"..\..\srclib\apr\include\apr_proc_mutex.h"\
"..\..\srclib\apr\include\apr_ring.h"\
"..\..\srclib\apr\include\apr_shm.h"\
"..\..\srclib\apr\include\apr_strings.h"\
"..\..\srclib\apr\include\apr_tables.h"\
"..\..\srclib\apr\include\apr_thread_mutex.h"\
"..\..\srclib\apr\include\apr_thread_proc.h"\
"..\..\srclib\apr\include\apr_time.h"\
"..\..\srclib\apr\include\apr_user.h"\
"..\..\srclib\apr\include\apr_want.h"\
".\cache_common.h"\
".\cache_util.h"\
".\mod_cache.h"\
.\mod_cache.c : \
"..\..\include\ap_config.h"\
"..\..\include\ap_config_layout.h"\
"..\..\include\ap_expr.h"\
"..\..\include\ap_hooks.h"\
"..\..\include\ap_mmn.h"\
"..\..\include\ap_regex.h"\
"..\..\include\ap_release.h"\
"..\..\include\apache_noprobes.h"\
"..\..\include\http_config.h"\
"..\..\include\http_connection.h"\
"..\..\include\http_core.h"\
"..\..\include\http_log.h"\
"..\..\include\http_main.h"\
"..\..\include\http_protocol.h"\
"..\..\include\http_request.h"\
"..\..\include\http_vhost.h"\
"..\..\include\httpd.h"\
"..\..\include\os.h"\
"..\..\include\util_cfgtree.h"\
"..\..\include\util_filter.h"\
"..\..\srclib\apr-util\include\apr_buckets.h"\
"..\..\srclib\apr-util\include\apr_date.h"\
"..\..\srclib\apr-util\include\apr_hooks.h"\
"..\..\srclib\apr-util\include\apr_md5.h"\
"..\..\srclib\apr-util\include\apr_optional.h"\
"..\..\srclib\apr-util\include\apr_optional_hooks.h"\
"..\..\srclib\apr-util\include\apr_uri.h"\
"..\..\srclib\apr-util\include\apr_xlate.h"\
"..\..\srclib\apr-util\include\apu.h"\
"..\..\srclib\apr\include\apr.h"\
"..\..\srclib\apr\include\apr_allocator.h"\
"..\..\srclib\apr\include\apr_atomic.h"\
"..\..\srclib\apr\include\apr_dso.h"\
"..\..\srclib\apr\include\apr_errno.h"\
"..\..\srclib\apr\include\apr_file_info.h"\
"..\..\srclib\apr\include\apr_file_io.h"\
"..\..\srclib\apr\include\apr_general.h"\
"..\..\srclib\apr\include\apr_global_mutex.h"\
"..\..\srclib\apr\include\apr_hash.h"\
"..\..\srclib\apr\include\apr_inherit.h"\
"..\..\srclib\apr\include\apr_lib.h"\
"..\..\srclib\apr\include\apr_mmap.h"\
"..\..\srclib\apr\include\apr_network_io.h"\
"..\..\srclib\apr\include\apr_poll.h"\
"..\..\srclib\apr\include\apr_pools.h"\
"..\..\srclib\apr\include\apr_portable.h"\
"..\..\srclib\apr\include\apr_proc_mutex.h"\
"..\..\srclib\apr\include\apr_ring.h"\
"..\..\srclib\apr\include\apr_shm.h"\
"..\..\srclib\apr\include\apr_strings.h"\
"..\..\srclib\apr\include\apr_tables.h"\
"..\..\srclib\apr\include\apr_thread_mutex.h"\
"..\..\srclib\apr\include\apr_thread_proc.h"\
"..\..\srclib\apr\include\apr_time.h"\
"..\..\srclib\apr\include\apr_user.h"\
"..\..\srclib\apr\include\apr_want.h"\
".\cache_common.h"\
".\cache_storage.h"\
".\cache_util.h"\
".\mod_cache.h"\
..\..\build\win32\httpd.rc : \
"..\..\include\ap_release.h"\

131
modules/cache/mod_cache.dsp vendored Normal file
View file

@ -0,0 +1,131 @@
# Microsoft Developer Studio Project File - Name="mod_cache" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=mod_cache - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "mod_cache.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "mod_cache.mak" CFG="mod_cache - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "mod_cache - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "mod_cache - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "mod_cache - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "MOD_CACHE_EXPORTS" /FD /c
# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../../srclib/apr-util/include" /I "../../srclib/apr/include" /I "../../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "CACHE_DECLARE_EXPORT" /D "MOD_CACHE_EXPORTS" /Fd"Release\mod_cache_src" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /fo"Release/mod_cache.res" /i "../../include" /i "../../srclib/apr/include" /d "NDEBUG" /d BIN_NAME="mod_cache.so" /d LONG_NAME="cache_module for Apache"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll
# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_cache.so" /base:@..\..\os\win32\BaseAddr.ref,mod_cache.so /opt:ref
# Begin Special Build Tool
TargetPath=.\Release\mod_cache.so
SOURCE="$(InputPath)"
PostBuild_Desc=Embed .manifest
PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2
# End Special Build Tool
!ELSEIF "$(CFG)" == "mod_cache - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c
# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../../srclib/apr-util/include" /I "../../srclib/apr/include" /I "../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "CACHE_DECLARE_EXPORT" /Fd"Debug\mod_cache_src" /FD /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /fo"Debug/mod_cache.res" /i "../../include" /i "../../srclib/apr/include" /d "_DEBUG" /d BIN_NAME="mod_cache.so" /d LONG_NAME="cache_module for Apache"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug
# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_cache.so" /base:@..\..\os\win32\BaseAddr.ref,mod_cache.so
# Begin Special Build Tool
TargetPath=.\Debug\mod_cache.so
SOURCE="$(InputPath)"
PostBuild_Desc=Embed .manifest
PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2
# End Special Build Tool
!ENDIF
# Begin Target
# Name "mod_cache - Win32 Release"
# Name "mod_cache - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90"
# Begin Source File
SOURCE=.\cache_storage.c
# End Source File
# Begin Source File
SOURCE=.\cache_util.c
# End Source File
# Begin Source File
SOURCE=.\mod_cache.c
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\mod_cache.h
# End Source File
# End Group
# Begin Source File
SOURCE=..\..\build\win32\httpd.rc
# End Source File
# End Target
# End Project

192
modules/cache/mod_cache.h vendored Normal file
View file

@ -0,0 +1,192 @@
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file mod_cache.h
* @brief Main include file for the Apache Transparent Cache
*
* @defgroup MOD_CACHE mod_cache
* @ingroup APACHE_MODS
* @{
*/
#ifndef MOD_CACHE_H
#define MOD_CACHE_H
#include "httpd.h"
#include "apr_date.h"
#include "apr_optional.h"
#include "apr_hooks.h"
#include "cache_common.h"
/* Create a set of CACHE_DECLARE(type), CACHE_DECLARE_NONSTD(type) and
* CACHE_DECLARE_DATA with appropriate export and import tags for the platform
*/
#if !defined(WIN32)
#define CACHE_DECLARE(type) type
#define CACHE_DECLARE_NONSTD(type) type
#define CACHE_DECLARE_DATA
#elif defined(CACHE_DECLARE_STATIC)
#define CACHE_DECLARE(type) type __stdcall
#define CACHE_DECLARE_NONSTD(type) type
#define CACHE_DECLARE_DATA
#elif defined(CACHE_DECLARE_EXPORT)
#define CACHE_DECLARE(type) __declspec(dllexport) type __stdcall
#define CACHE_DECLARE_NONSTD(type) __declspec(dllexport) type
#define CACHE_DECLARE_DATA __declspec(dllexport)
#else
#define CACHE_DECLARE(type) __declspec(dllimport) type __stdcall
#define CACHE_DECLARE_NONSTD(type) __declspec(dllimport) type
#define CACHE_DECLARE_DATA __declspec(dllimport)
#endif
/* cache info information */
typedef struct cache_info cache_info;
struct cache_info {
/**
* the original time corresponding to the 'Date:' header of the request
* served
*/
apr_time_t date;
/** a time when the cached entity is due to expire */
apr_time_t expire;
/** r->request_time from the same request */
apr_time_t request_time;
/** apr_time_now() at the time the entity was actually cached */
apr_time_t response_time;
/**
* HTTP status code of the cached entity. Though not necessarily the
* status code finally issued to the request.
*/
int status;
/* cached cache-control */
cache_control_t control;
};
/* cache handle information */
typedef struct cache_object cache_object_t;
struct cache_object {
const char *key;
cache_object_t *next;
cache_info info;
/* Opaque portion (specific to the implementation) of the cache object */
void *vobj;
};
typedef struct cache_handle cache_handle_t;
struct cache_handle {
cache_object_t *cache_obj;
apr_table_t *req_hdrs; /* cached request headers */
apr_table_t *resp_hdrs; /* cached response headers */
};
#define CACHE_PROVIDER_GROUP "cache"
typedef struct {
int (*remove_entity) (cache_handle_t *h);
apr_status_t (*store_headers)(cache_handle_t *h, request_rec *r, cache_info *i);
apr_status_t (*store_body)(cache_handle_t *h, request_rec *r, apr_bucket_brigade *in,
apr_bucket_brigade *out);
apr_status_t (*recall_headers) (cache_handle_t *h, request_rec *r);
apr_status_t (*recall_body) (cache_handle_t *h, apr_pool_t *p, apr_bucket_brigade *bb);
int (*create_entity) (cache_handle_t *h, request_rec *r,
const char *urlkey, apr_off_t len, apr_bucket_brigade *bb);
int (*open_entity) (cache_handle_t *h, request_rec *r,
const char *urlkey);
int (*remove_url) (cache_handle_t *h, request_rec *r);
apr_status_t (*commit_entity)(cache_handle_t *h, request_rec *r);
apr_status_t (*invalidate_entity)(cache_handle_t *h, request_rec *r);
} cache_provider;
typedef enum {
AP_CACHE_HIT,
AP_CACHE_REVALIDATE,
AP_CACHE_MISS,
AP_CACHE_INVALIDATE
} ap_cache_status_e;
#define AP_CACHE_HIT_ENV "cache-hit"
#define AP_CACHE_REVALIDATE_ENV "cache-revalidate"
#define AP_CACHE_MISS_ENV "cache-miss"
#define AP_CACHE_INVALIDATE_ENV "cache-invalidate"
#define AP_CACHE_STATUS_ENV "cache-status"
/* cache_util.c */
/* do a HTTP/1.1 age calculation */
CACHE_DECLARE(apr_time_t) ap_cache_current_age(cache_info *info, const apr_time_t age_value,
apr_time_t now);
CACHE_DECLARE(apr_time_t) ap_cache_hex2usec(const char *x);
CACHE_DECLARE(void) ap_cache_usec2hex(apr_time_t j, char *y);
CACHE_DECLARE(char *) ap_cache_generate_name(apr_pool_t *p, int dirlevels,
int dirlength,
const char *name);
CACHE_DECLARE(const char *)ap_cache_tokstr(apr_pool_t *p, const char *list, const char **str);
/* Create a new table consisting of those elements from an
* headers table that are allowed to be stored in a cache.
*/
CACHE_DECLARE(apr_table_t *)ap_cache_cacheable_headers(apr_pool_t *pool,
apr_table_t *t,
server_rec *s);
/* Create a new table consisting of those elements from an input
* headers table that are allowed to be stored in a cache.
*/
CACHE_DECLARE(apr_table_t *)ap_cache_cacheable_headers_in(request_rec *r);
/* Create a new table consisting of those elements from an output
* headers table that are allowed to be stored in a cache;
* ensure there is a content type and capture any errors.
*/
CACHE_DECLARE(apr_table_t *)ap_cache_cacheable_headers_out(request_rec *r);
/**
* Parse the Cache-Control and Pragma headers in one go, marking
* which tokens appear within the header. Populate the structure
* passed in.
*/
int ap_cache_control(request_rec *r, cache_control_t *cc, const char *cc_header,
const char *pragma_header, apr_table_t *headers);
/* hooks */
/**
* Cache status hook.
* This hook is called as soon as the cache has made a decision as to whether
* an entity should be served from cache (hit), should be served from cache
* after a successful validation (revalidate), or served from the backend
* and potentially cached (miss).
*
* A basic implementation of this hook exists in mod_cache which writes this
* information to the subprocess environment, and optionally to request
* headers. Further implementations may add hooks as appropriate to perform
* more advanced processing, or to store statistics about the cache behaviour.
*/
APR_DECLARE_EXTERNAL_HOOK(cache, CACHE, int, cache_status, (cache_handle_t *h,
request_rec *r, apr_table_t *headers, ap_cache_status_e status,
const char *reason))
APR_DECLARE_OPTIONAL_FN(apr_status_t,
ap_cache_generate_key,
(request_rec *r, apr_pool_t*p, const char **key));
#endif /*MOD_CACHE_H*/
/** @} */

370
modules/cache/mod_cache.mak vendored Normal file
View file

@ -0,0 +1,370 @@
# Microsoft Developer Studio Generated NMAKE File, Based on mod_cache.dsp
!IF "$(CFG)" == ""
CFG=mod_cache - Win32 Debug
!MESSAGE No configuration specified. Defaulting to mod_cache - Win32 Debug.
!ENDIF
!IF "$(CFG)" != "mod_cache - Win32 Release" && "$(CFG)" != "mod_cache - Win32 Debug"
!MESSAGE Invalid configuration "$(CFG)" specified.
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "mod_cache.mak" CFG="mod_cache - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "mod_cache - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "mod_cache - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
!ERROR An invalid configuration is specified.
!ENDIF
!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF
!IF "$(CFG)" == "mod_cache - Win32 Release"
OUTDIR=.\Release
INTDIR=.\Release
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
# Begin Custom Macros
OutDir=.\Release
# End Custom Macros
!IF "$(RECURSE)" == "0"
ALL : "$(OUTDIR)\mod_cache.so" "$(DS_POSTBUILD_DEP)"
!ELSE
ALL : "libhttpd - Win32 Release" "libaprutil - Win32 Release" "libapr - Win32 Release" "$(OUTDIR)\mod_cache.so" "$(DS_POSTBUILD_DEP)"
!ENDIF
!IF "$(RECURSE)" == "1"
CLEAN :"libapr - Win32 ReleaseCLEAN" "libaprutil - Win32 ReleaseCLEAN" "libhttpd - Win32 ReleaseCLEAN"
!ELSE
CLEAN :
!ENDIF
-@erase "$(INTDIR)\cache_storage.obj"
-@erase "$(INTDIR)\cache_util.obj"
-@erase "$(INTDIR)\mod_cache.obj"
-@erase "$(INTDIR)\mod_cache.res"
-@erase "$(INTDIR)\mod_cache_src.idb"
-@erase "$(INTDIR)\mod_cache_src.pdb"
-@erase "$(OUTDIR)\mod_cache.exp"
-@erase "$(OUTDIR)\mod_cache.lib"
-@erase "$(OUTDIR)\mod_cache.pdb"
-@erase "$(OUTDIR)\mod_cache.so"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP=cl.exe
CPP_PROJ=/nologo /MD /W3 /Zi /O2 /Oy- /I "../../srclib/apr-util/include" /I "../../srclib/apr/include" /I "../../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "CACHE_DECLARE_EXPORT" /D "MOD_CACHE_EXPORTS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\mod_cache_src" /FD /c
.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
MTL=midl.exe
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
RSC=rc.exe
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\mod_cache.res" /i "../../include" /i "../../srclib/apr/include" /d "NDEBUG" /d BIN_NAME="mod_cache.so" /d LONG_NAME="cache_module for Apache"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\mod_cache.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=kernel32.lib /nologo /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\mod_cache.pdb" /debug /out:"$(OUTDIR)\mod_cache.so" /implib:"$(OUTDIR)\mod_cache.lib" /base:@..\..\os\win32\BaseAddr.ref,mod_cache.so /opt:ref
LINK32_OBJS= \
"$(INTDIR)\cache_storage.obj" \
"$(INTDIR)\cache_util.obj" \
"$(INTDIR)\mod_cache.obj" \
"$(INTDIR)\mod_cache.res" \
"..\..\srclib\apr\Release\libapr-1.lib" \
"..\..\srclib\apr-util\Release\libaprutil-1.lib" \
"..\..\Release\libhttpd.lib"
"$(OUTDIR)\mod_cache.so" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
TargetPath=.\Release\mod_cache.so
SOURCE="$(InputPath)"
PostBuild_Desc=Embed .manifest
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
# Begin Custom Macros
OutDir=.\Release
# End Custom Macros
"$(DS_POSTBUILD_DEP)" : "$(OUTDIR)\mod_cache.so"
if exist .\Release\mod_cache.so.manifest mt.exe -manifest .\Release\mod_cache.so.manifest -outputresource:.\Release\mod_cache.so;2
echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)"
!ELSEIF "$(CFG)" == "mod_cache - Win32 Debug"
OUTDIR=.\Debug
INTDIR=.\Debug
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
# Begin Custom Macros
OutDir=.\Debug
# End Custom Macros
!IF "$(RECURSE)" == "0"
ALL : "$(OUTDIR)\mod_cache.so" "$(DS_POSTBUILD_DEP)"
!ELSE
ALL : "libhttpd - Win32 Debug" "libaprutil - Win32 Debug" "libapr - Win32 Debug" "$(OUTDIR)\mod_cache.so" "$(DS_POSTBUILD_DEP)"
!ENDIF
!IF "$(RECURSE)" == "1"
CLEAN :"libapr - Win32 DebugCLEAN" "libaprutil - Win32 DebugCLEAN" "libhttpd - Win32 DebugCLEAN"
!ELSE
CLEAN :
!ENDIF
-@erase "$(INTDIR)\cache_storage.obj"
-@erase "$(INTDIR)\cache_util.obj"
-@erase "$(INTDIR)\mod_cache.obj"
-@erase "$(INTDIR)\mod_cache.res"
-@erase "$(INTDIR)\mod_cache_src.idb"
-@erase "$(INTDIR)\mod_cache_src.pdb"
-@erase "$(OUTDIR)\mod_cache.exp"
-@erase "$(OUTDIR)\mod_cache.lib"
-@erase "$(OUTDIR)\mod_cache.pdb"
-@erase "$(OUTDIR)\mod_cache.so"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP=cl.exe
CPP_PROJ=/nologo /MDd /W3 /Zi /Od /I "../../srclib/apr-util/include" /I "../../srclib/apr/include" /I "../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "CACHE_DECLARE_EXPORT" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\mod_cache_src" /FD /EHsc /c
.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
MTL=midl.exe
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
RSC=rc.exe
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\mod_cache.res" /i "../../include" /i "../../srclib/apr/include" /d "_DEBUG" /d BIN_NAME="mod_cache.so" /d LONG_NAME="cache_module for Apache"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\mod_cache.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=kernel32.lib /nologo /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\mod_cache.pdb" /debug /out:"$(OUTDIR)\mod_cache.so" /implib:"$(OUTDIR)\mod_cache.lib" /base:@..\..\os\win32\BaseAddr.ref,mod_cache.so
LINK32_OBJS= \
"$(INTDIR)\cache_storage.obj" \
"$(INTDIR)\cache_util.obj" \
"$(INTDIR)\mod_cache.obj" \
"$(INTDIR)\mod_cache.res" \
"..\..\srclib\apr\Debug\libapr-1.lib" \
"..\..\srclib\apr-util\Debug\libaprutil-1.lib" \
"..\..\Debug\libhttpd.lib"
"$(OUTDIR)\mod_cache.so" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
TargetPath=.\Debug\mod_cache.so
SOURCE="$(InputPath)"
PostBuild_Desc=Embed .manifest
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
# Begin Custom Macros
OutDir=.\Debug
# End Custom Macros
"$(DS_POSTBUILD_DEP)" : "$(OUTDIR)\mod_cache.so"
if exist .\Debug\mod_cache.so.manifest mt.exe -manifest .\Debug\mod_cache.so.manifest -outputresource:.\Debug\mod_cache.so;2
echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)"
!ENDIF
!IF "$(NO_EXTERNAL_DEPS)" != "1"
!IF EXISTS("mod_cache.dep")
!INCLUDE "mod_cache.dep"
!ELSE
!MESSAGE Warning: cannot find "mod_cache.dep"
!ENDIF
!ENDIF
!IF "$(CFG)" == "mod_cache - Win32 Release" || "$(CFG)" == "mod_cache - Win32 Debug"
SOURCE=.\cache_storage.c
"$(INTDIR)\cache_storage.obj" : $(SOURCE) "$(INTDIR)"
SOURCE=.\cache_util.c
"$(INTDIR)\cache_util.obj" : $(SOURCE) "$(INTDIR)"
SOURCE=.\mod_cache.c
"$(INTDIR)\mod_cache.obj" : $(SOURCE) "$(INTDIR)"
!IF "$(CFG)" == "mod_cache - Win32 Release"
"libapr - Win32 Release" :
cd ".\..\..\srclib\apr"
$(MAKE) /$(MAKEFLAGS) /F ".\libapr.mak" CFG="libapr - Win32 Release"
cd "..\..\modules\cache"
"libapr - Win32 ReleaseCLEAN" :
cd ".\..\..\srclib\apr"
$(MAKE) /$(MAKEFLAGS) /F ".\libapr.mak" CFG="libapr - Win32 Release" RECURSE=1 CLEAN
cd "..\..\modules\cache"
!ELSEIF "$(CFG)" == "mod_cache - Win32 Debug"
"libapr - Win32 Debug" :
cd ".\..\..\srclib\apr"
$(MAKE) /$(MAKEFLAGS) /F ".\libapr.mak" CFG="libapr - Win32 Debug"
cd "..\..\modules\cache"
"libapr - Win32 DebugCLEAN" :
cd ".\..\..\srclib\apr"
$(MAKE) /$(MAKEFLAGS) /F ".\libapr.mak" CFG="libapr - Win32 Debug" RECURSE=1 CLEAN
cd "..\..\modules\cache"
!ENDIF
!IF "$(CFG)" == "mod_cache - Win32 Release"
"libaprutil - Win32 Release" :
cd ".\..\..\srclib\apr-util"
$(MAKE) /$(MAKEFLAGS) /F ".\libaprutil.mak" CFG="libaprutil - Win32 Release"
cd "..\..\modules\cache"
"libaprutil - Win32 ReleaseCLEAN" :
cd ".\..\..\srclib\apr-util"
$(MAKE) /$(MAKEFLAGS) /F ".\libaprutil.mak" CFG="libaprutil - Win32 Release" RECURSE=1 CLEAN
cd "..\..\modules\cache"
!ELSEIF "$(CFG)" == "mod_cache - Win32 Debug"
"libaprutil - Win32 Debug" :
cd ".\..\..\srclib\apr-util"
$(MAKE) /$(MAKEFLAGS) /F ".\libaprutil.mak" CFG="libaprutil - Win32 Debug"
cd "..\..\modules\cache"
"libaprutil - Win32 DebugCLEAN" :
cd ".\..\..\srclib\apr-util"
$(MAKE) /$(MAKEFLAGS) /F ".\libaprutil.mak" CFG="libaprutil - Win32 Debug" RECURSE=1 CLEAN
cd "..\..\modules\cache"
!ENDIF
!IF "$(CFG)" == "mod_cache - Win32 Release"
"libhttpd - Win32 Release" :
cd ".\..\.."
$(MAKE) /$(MAKEFLAGS) /F ".\libhttpd.mak" CFG="libhttpd - Win32 Release"
cd ".\modules\cache"
"libhttpd - Win32 ReleaseCLEAN" :
cd ".\..\.."
$(MAKE) /$(MAKEFLAGS) /F ".\libhttpd.mak" CFG="libhttpd - Win32 Release" RECURSE=1 CLEAN
cd ".\modules\cache"
!ELSEIF "$(CFG)" == "mod_cache - Win32 Debug"
"libhttpd - Win32 Debug" :
cd ".\..\.."
$(MAKE) /$(MAKEFLAGS) /F ".\libhttpd.mak" CFG="libhttpd - Win32 Debug"
cd ".\modules\cache"
"libhttpd - Win32 DebugCLEAN" :
cd ".\..\.."
$(MAKE) /$(MAKEFLAGS) /F ".\libhttpd.mak" CFG="libhttpd - Win32 Debug" RECURSE=1 CLEAN
cd ".\modules\cache"
!ENDIF
SOURCE=..\..\build\win32\httpd.rc
!IF "$(CFG)" == "mod_cache - Win32 Release"
"$(INTDIR)\mod_cache.res" : $(SOURCE) "$(INTDIR)"
$(RSC) /l 0x409 /fo"$(INTDIR)\mod_cache.res" /i "../../include" /i "../../srclib/apr/include" /i "../../build\win32" /d "NDEBUG" /d BIN_NAME="mod_cache.so" /d LONG_NAME="cache_module for Apache" $(SOURCE)
!ELSEIF "$(CFG)" == "mod_cache - Win32 Debug"
"$(INTDIR)\mod_cache.res" : $(SOURCE) "$(INTDIR)"
$(RSC) /l 0x409 /fo"$(INTDIR)\mod_cache.res" /i "../../include" /i "../../srclib/apr/include" /i "../../build\win32" /d "_DEBUG" /d BIN_NAME="mod_cache.so" /d LONG_NAME="cache_module for Apache" $(SOURCE)
!ENDIF
!ENDIF

1585
modules/cache/mod_cache_disk.c vendored Normal file

File diff suppressed because it is too large Load diff

59
modules/cache/mod_cache_disk.dep vendored Normal file
View file

@ -0,0 +1,59 @@
# Microsoft Developer Studio Generated Dependency File, included by mod_cache_disk.mak
..\..\build\win32\httpd.rc : \
"..\..\include\ap_release.h"\
.\mod_cache_disk.c : \
"..\..\include\ap_config.h"\
"..\..\include\ap_config_layout.h"\
"..\..\include\ap_expr.h"\
"..\..\include\ap_hooks.h"\
"..\..\include\ap_mmn.h"\
"..\..\include\ap_provider.h"\
"..\..\include\ap_regex.h"\
"..\..\include\ap_release.h"\
"..\..\include\apache_noprobes.h"\
"..\..\include\http_config.h"\
"..\..\include\http_core.h"\
"..\..\include\http_log.h"\
"..\..\include\httpd.h"\
"..\..\include\os.h"\
"..\..\include\util_cfgtree.h"\
"..\..\include\util_charset.h"\
"..\..\include\util_filter.h"\
"..\..\include\util_script.h"\
"..\..\srclib\apr-util\include\apr_buckets.h"\
"..\..\srclib\apr-util\include\apr_date.h"\
"..\..\srclib\apr-util\include\apr_hooks.h"\
"..\..\srclib\apr-util\include\apr_optional.h"\
"..\..\srclib\apr-util\include\apr_optional_hooks.h"\
"..\..\srclib\apr-util\include\apr_uri.h"\
"..\..\srclib\apr-util\include\apr_xlate.h"\
"..\..\srclib\apr-util\include\apu.h"\
"..\..\srclib\apr\include\apr.h"\
"..\..\srclib\apr\include\apr_allocator.h"\
"..\..\srclib\apr\include\apr_errno.h"\
"..\..\srclib\apr\include\apr_file_info.h"\
"..\..\srclib\apr\include\apr_file_io.h"\
"..\..\srclib\apr\include\apr_general.h"\
"..\..\srclib\apr\include\apr_hash.h"\
"..\..\srclib\apr\include\apr_inherit.h"\
"..\..\srclib\apr\include\apr_lib.h"\
"..\..\srclib\apr\include\apr_mmap.h"\
"..\..\srclib\apr\include\apr_network_io.h"\
"..\..\srclib\apr\include\apr_poll.h"\
"..\..\srclib\apr\include\apr_pools.h"\
"..\..\srclib\apr\include\apr_ring.h"\
"..\..\srclib\apr\include\apr_strings.h"\
"..\..\srclib\apr\include\apr_tables.h"\
"..\..\srclib\apr\include\apr_thread_mutex.h"\
"..\..\srclib\apr\include\apr_thread_proc.h"\
"..\..\srclib\apr\include\apr_time.h"\
"..\..\srclib\apr\include\apr_user.h"\
"..\..\srclib\apr\include\apr_want.h"\
".\cache_common.h"\
".\cache_disk_common.h"\
".\mod_cache.h"\
".\mod_cache_disk.h"\

115
modules/cache/mod_cache_disk.dsp vendored Normal file
View file

@ -0,0 +1,115 @@
# Microsoft Developer Studio Project File - Name="mod_cache_disk" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=mod_cache_disk - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "mod_cache_disk.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "mod_cache_disk.mak" CFG="mod_cache_disk - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "mod_cache_disk - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "mod_cache_disk - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "mod_cache_disk - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../../srclib/apr-util/include" /I "../../srclib/apr/include" /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Fd"Release\mod_cache_disk_src" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /fo"Release/mod_cache_disk.res" /i "../../include" /i "../../srclib/apr/include" /d "NDEBUG" /d BIN_NAME="mod_cache_disk.so" /d LONG_NAME="cache_disk_module for Apache"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll
# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_cache_disk.so" /base:@..\..\os\win32\BaseAddr.ref,mod_cache_disk.so /opt:ref
# Begin Special Build Tool
TargetPath=.\Release\mod_cache_disk.so
SOURCE="$(InputPath)"
PostBuild_Desc=Embed .manifest
PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2
# End Special Build Tool
!ELSEIF "$(CFG)" == "mod_cache_disk - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c
# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../../srclib/apr-util/include" /I "../../srclib/apr/include" /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /Fd"Debug\mod_cache_disk_src" /FD /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /fo"Debug/mod_cache_disk.res" /i "../../include" /i "../../srclib/apr/include" /d "_DEBUG" /d BIN_NAME="mod_cache_disk.so" /d LONG_NAME="cache_disk_module for Apache"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug
# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_cache_disk.so" /base:@..\..\os\win32\BaseAddr.ref,mod_cache_disk.so
# Begin Special Build Tool
TargetPath=.\Debug\mod_cache_disk.so
SOURCE="$(InputPath)"
PostBuild_Desc=Embed .manifest
PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2
# End Special Build Tool
!ENDIF
# Begin Target
# Name "mod_cache_disk - Win32 Release"
# Name "mod_cache_disk - Win32 Debug"
# Begin Source File
SOURCE=.\mod_cache.h
# End Source File
# Begin Source File
SOURCE=.\mod_cache_disk.c
# End Source File
# Begin Source File
SOURCE=..\..\build\win32\httpd.rc
# End Source File
# End Target
# End Project

91
modules/cache/mod_cache_disk.h vendored Normal file
View file

@ -0,0 +1,91 @@
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef MOD_CACHE_DISK_H
#define MOD_CACHE_DISK_H
#include "apr_file_io.h"
#include "cache_disk_common.h"
/*
* include for mod_cache_disk: Disk Based HTTP 1.1 Cache.
*/
typedef struct {
apr_pool_t *pool;
const char *file;
apr_file_t *fd;
char *tempfile;
apr_file_t *tempfd;
} disk_cache_file_t;
/*
* disk_cache_object_t
* Pointed to by cache_object_t::vobj
*/
typedef struct disk_cache_object {
const char *root; /* the location of the cache directory */
apr_size_t root_len;
const char *prefix;
disk_cache_file_t data; /* data file structure */
disk_cache_file_t hdrs; /* headers file structure */
disk_cache_file_t vary; /* vary file structure */
const char *hashfile; /* Computed hash key for this URI */
const char *name; /* Requested URI without vary bits - suitable for mortals. */
const char *key; /* On-disk prefix; URI with Vary bits (if present) */
apr_off_t file_size; /* File size of the cached data file */
disk_cache_info_t disk_info; /* Header information. */
apr_table_t *headers_in; /* Input headers to save */
apr_table_t *headers_out; /* Output headers to save */
apr_off_t offset; /* Max size to set aside */
apr_time_t timeout; /* Max time to set aside */
unsigned int done:1; /* Is the attempt to cache complete? */
} disk_cache_object_t;
/*
* mod_cache_disk configuration
*/
/* TODO: Make defaults OS specific */
#define CACHEFILE_LEN 20 /* must be less than HASH_LEN/2 */
#define DEFAULT_DIRLEVELS 2
#define DEFAULT_DIRLENGTH 2
#define DEFAULT_MIN_FILE_SIZE 1
#define DEFAULT_MAX_FILE_SIZE 1000000
#define DEFAULT_READSIZE 0
#define DEFAULT_READTIME 0
typedef struct {
const char* cache_root;
apr_size_t cache_root_len;
int dirlevels; /* Number of levels of subdirectories */
int dirlength; /* Length of subdirectory names */
} disk_cache_conf;
typedef struct {
apr_off_t minfs; /* minimum file size for cached files */
apr_off_t maxfs; /* maximum file size for cached files */
apr_off_t readsize; /* maximum data to attempt to cache in one go */
apr_time_t readtime; /* maximum time taken to cache in one go */
unsigned int minfs_set:1;
unsigned int maxfs_set:1;
unsigned int readsize_set:1;
unsigned int readtime_set:1;
} disk_cache_dir_conf;
#endif /*MOD_CACHE_DISK_H*/

381
modules/cache/mod_cache_disk.mak vendored Normal file
View file

@ -0,0 +1,381 @@
# Microsoft Developer Studio Generated NMAKE File, Based on mod_cache_disk.dsp
!IF "$(CFG)" == ""
CFG=mod_cache_disk - Win32 Debug
!MESSAGE No configuration specified. Defaulting to mod_cache_disk - Win32 Debug.
!ENDIF
!IF "$(CFG)" != "mod_cache_disk - Win32 Release" && "$(CFG)" != "mod_cache_disk - Win32 Debug"
!MESSAGE Invalid configuration "$(CFG)" specified.
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "mod_cache_disk.mak" CFG="mod_cache_disk - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "mod_cache_disk - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "mod_cache_disk - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
!ERROR An invalid configuration is specified.
!ENDIF
!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF
!IF "$(CFG)" == "mod_cache_disk - Win32 Release"
OUTDIR=.\Release
INTDIR=.\Release
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
# Begin Custom Macros
OutDir=.\Release
# End Custom Macros
!IF "$(RECURSE)" == "0"
ALL : "$(OUTDIR)\mod_cache_disk.so" "$(DS_POSTBUILD_DEP)"
!ELSE
ALL : "mod_cache - Win32 Release" "libhttpd - Win32 Release" "libaprutil - Win32 Release" "libapr - Win32 Release" "$(OUTDIR)\mod_cache_disk.so" "$(DS_POSTBUILD_DEP)"
!ENDIF
!IF "$(RECURSE)" == "1"
CLEAN :"libapr - Win32 ReleaseCLEAN" "libaprutil - Win32 ReleaseCLEAN" "libhttpd - Win32 ReleaseCLEAN" "mod_cache - Win32 ReleaseCLEAN"
!ELSE
CLEAN :
!ENDIF
-@erase "$(INTDIR)\mod_cache_disk.obj"
-@erase "$(INTDIR)\mod_cache_disk.res"
-@erase "$(INTDIR)\mod_cache_disk_src.idb"
-@erase "$(INTDIR)\mod_cache_disk_src.pdb"
-@erase "$(OUTDIR)\mod_cache_disk.exp"
-@erase "$(OUTDIR)\mod_cache_disk.lib"
-@erase "$(OUTDIR)\mod_cache_disk.pdb"
-@erase "$(OUTDIR)\mod_cache_disk.so"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP=cl.exe
CPP_PROJ=/nologo /MD /W3 /Zi /O2 /Oy- /I "../../srclib/apr-util/include" /I "../../srclib/apr/include" /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\mod_cache_disk_src" /FD /c
.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
MTL=midl.exe
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
RSC=rc.exe
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\mod_cache_disk.res" /i "../../include" /i "../../srclib/apr/include" /d "NDEBUG" /d BIN_NAME="mod_cache_disk.so" /d LONG_NAME="cache_disk_module for Apache"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\mod_cache_disk.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=kernel32.lib /nologo /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\mod_cache_disk.pdb" /debug /out:"$(OUTDIR)\mod_cache_disk.so" /implib:"$(OUTDIR)\mod_cache_disk.lib" /base:@..\..\os\win32\BaseAddr.ref,mod_cache_disk.so /opt:ref
LINK32_OBJS= \
"$(INTDIR)\mod_cache_disk.obj" \
"$(INTDIR)\mod_cache_disk.res" \
"..\..\srclib\apr\Release\libapr-1.lib" \
"..\..\srclib\apr-util\Release\libaprutil-1.lib" \
"..\..\Release\libhttpd.lib" \
"$(OUTDIR)\mod_cache.lib"
"$(OUTDIR)\mod_cache_disk.so" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
TargetPath=.\Release\mod_cache_disk.so
SOURCE="$(InputPath)"
PostBuild_Desc=Embed .manifest
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
# Begin Custom Macros
OutDir=.\Release
# End Custom Macros
"$(DS_POSTBUILD_DEP)" : "$(OUTDIR)\mod_cache_disk.so"
if exist .\Release\mod_cache_disk.so.manifest mt.exe -manifest .\Release\mod_cache_disk.so.manifest -outputresource:.\Release\mod_cache_disk.so;2
echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)"
!ELSEIF "$(CFG)" == "mod_cache_disk - Win32 Debug"
OUTDIR=.\Debug
INTDIR=.\Debug
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
# Begin Custom Macros
OutDir=.\Debug
# End Custom Macros
!IF "$(RECURSE)" == "0"
ALL : "$(OUTDIR)\mod_cache_disk.so" "$(DS_POSTBUILD_DEP)"
!ELSE
ALL : "mod_cache - Win32 Debug" "libhttpd - Win32 Debug" "libaprutil - Win32 Debug" "libapr - Win32 Debug" "$(OUTDIR)\mod_cache_disk.so" "$(DS_POSTBUILD_DEP)"
!ENDIF
!IF "$(RECURSE)" == "1"
CLEAN :"libapr - Win32 DebugCLEAN" "libaprutil - Win32 DebugCLEAN" "libhttpd - Win32 DebugCLEAN" "mod_cache - Win32 DebugCLEAN"
!ELSE
CLEAN :
!ENDIF
-@erase "$(INTDIR)\mod_cache_disk.obj"
-@erase "$(INTDIR)\mod_cache_disk.res"
-@erase "$(INTDIR)\mod_cache_disk_src.idb"
-@erase "$(INTDIR)\mod_cache_disk_src.pdb"
-@erase "$(OUTDIR)\mod_cache_disk.exp"
-@erase "$(OUTDIR)\mod_cache_disk.lib"
-@erase "$(OUTDIR)\mod_cache_disk.pdb"
-@erase "$(OUTDIR)\mod_cache_disk.so"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP=cl.exe
CPP_PROJ=/nologo /MDd /W3 /Zi /Od /I "../../srclib/apr-util/include" /I "../../srclib/apr/include" /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\mod_cache_disk_src" /FD /EHsc /c
.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
MTL=midl.exe
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
RSC=rc.exe
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\mod_cache_disk.res" /i "../../include" /i "../../srclib/apr/include" /d "_DEBUG" /d BIN_NAME="mod_cache_disk.so" /d LONG_NAME="cache_disk_module for Apache"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\mod_cache_disk.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=kernel32.lib /nologo /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\mod_cache_disk.pdb" /debug /out:"$(OUTDIR)\mod_cache_disk.so" /implib:"$(OUTDIR)\mod_cache_disk.lib" /base:@..\..\os\win32\BaseAddr.ref,mod_cache_disk.so
LINK32_OBJS= \
"$(INTDIR)\mod_cache_disk.obj" \
"$(INTDIR)\mod_cache_disk.res" \
"..\..\srclib\apr\Debug\libapr-1.lib" \
"..\..\srclib\apr-util\Debug\libaprutil-1.lib" \
"..\..\Debug\libhttpd.lib" \
"$(OUTDIR)\mod_cache.lib"
"$(OUTDIR)\mod_cache_disk.so" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
TargetPath=.\Debug\mod_cache_disk.so
SOURCE="$(InputPath)"
PostBuild_Desc=Embed .manifest
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
# Begin Custom Macros
OutDir=.\Debug
# End Custom Macros
"$(DS_POSTBUILD_DEP)" : "$(OUTDIR)\mod_cache_disk.so"
if exist .\Debug\mod_cache_disk.so.manifest mt.exe -manifest .\Debug\mod_cache_disk.so.manifest -outputresource:.\Debug\mod_cache_disk.so;2
echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)"
!ENDIF
!IF "$(NO_EXTERNAL_DEPS)" != "1"
!IF EXISTS("mod_cache_disk.dep")
!INCLUDE "mod_cache_disk.dep"
!ELSE
!MESSAGE Warning: cannot find "mod_cache_disk.dep"
!ENDIF
!ENDIF
!IF "$(CFG)" == "mod_cache_disk - Win32 Release" || "$(CFG)" == "mod_cache_disk - Win32 Debug"
!IF "$(CFG)" == "mod_cache_disk - Win32 Release"
"libapr - Win32 Release" :
cd ".\..\..\srclib\apr"
$(MAKE) /$(MAKEFLAGS) /F ".\libapr.mak" CFG="libapr - Win32 Release"
cd "..\..\modules\cache"
"libapr - Win32 ReleaseCLEAN" :
cd ".\..\..\srclib\apr"
$(MAKE) /$(MAKEFLAGS) /F ".\libapr.mak" CFG="libapr - Win32 Release" RECURSE=1 CLEAN
cd "..\..\modules\cache"
!ELSEIF "$(CFG)" == "mod_cache_disk - Win32 Debug"
"libapr - Win32 Debug" :
cd ".\..\..\srclib\apr"
$(MAKE) /$(MAKEFLAGS) /F ".\libapr.mak" CFG="libapr - Win32 Debug"
cd "..\..\modules\cache"
"libapr - Win32 DebugCLEAN" :
cd ".\..\..\srclib\apr"
$(MAKE) /$(MAKEFLAGS) /F ".\libapr.mak" CFG="libapr - Win32 Debug" RECURSE=1 CLEAN
cd "..\..\modules\cache"
!ENDIF
!IF "$(CFG)" == "mod_cache_disk - Win32 Release"
"libaprutil - Win32 Release" :
cd ".\..\..\srclib\apr-util"
$(MAKE) /$(MAKEFLAGS) /F ".\libaprutil.mak" CFG="libaprutil - Win32 Release"
cd "..\..\modules\cache"
"libaprutil - Win32 ReleaseCLEAN" :
cd ".\..\..\srclib\apr-util"
$(MAKE) /$(MAKEFLAGS) /F ".\libaprutil.mak" CFG="libaprutil - Win32 Release" RECURSE=1 CLEAN
cd "..\..\modules\cache"
!ELSEIF "$(CFG)" == "mod_cache_disk - Win32 Debug"
"libaprutil - Win32 Debug" :
cd ".\..\..\srclib\apr-util"
$(MAKE) /$(MAKEFLAGS) /F ".\libaprutil.mak" CFG="libaprutil - Win32 Debug"
cd "..\..\modules\cache"
"libaprutil - Win32 DebugCLEAN" :
cd ".\..\..\srclib\apr-util"
$(MAKE) /$(MAKEFLAGS) /F ".\libaprutil.mak" CFG="libaprutil - Win32 Debug" RECURSE=1 CLEAN
cd "..\..\modules\cache"
!ENDIF
!IF "$(CFG)" == "mod_cache_disk - Win32 Release"
"libhttpd - Win32 Release" :
cd ".\..\.."
$(MAKE) /$(MAKEFLAGS) /F ".\libhttpd.mak" CFG="libhttpd - Win32 Release"
cd ".\modules\cache"
"libhttpd - Win32 ReleaseCLEAN" :
cd ".\..\.."
$(MAKE) /$(MAKEFLAGS) /F ".\libhttpd.mak" CFG="libhttpd - Win32 Release" RECURSE=1 CLEAN
cd ".\modules\cache"
!ELSEIF "$(CFG)" == "mod_cache_disk - Win32 Debug"
"libhttpd - Win32 Debug" :
cd ".\..\.."
$(MAKE) /$(MAKEFLAGS) /F ".\libhttpd.mak" CFG="libhttpd - Win32 Debug"
cd ".\modules\cache"
"libhttpd - Win32 DebugCLEAN" :
cd ".\..\.."
$(MAKE) /$(MAKEFLAGS) /F ".\libhttpd.mak" CFG="libhttpd - Win32 Debug" RECURSE=1 CLEAN
cd ".\modules\cache"
!ENDIF
!IF "$(CFG)" == "mod_cache_disk - Win32 Release"
"mod_cache - Win32 Release" :
cd "."
$(MAKE) /$(MAKEFLAGS) /F ".\mod_cache.mak" CFG="mod_cache - Win32 Release"
cd "."
"mod_cache - Win32 ReleaseCLEAN" :
cd "."
$(MAKE) /$(MAKEFLAGS) /F ".\mod_cache.mak" CFG="mod_cache - Win32 Release" RECURSE=1 CLEAN
cd "."
!ELSEIF "$(CFG)" == "mod_cache_disk - Win32 Debug"
"mod_cache - Win32 Debug" :
cd "."
$(MAKE) /$(MAKEFLAGS) /F ".\mod_cache.mak" CFG="mod_cache - Win32 Debug"
cd "."
"mod_cache - Win32 DebugCLEAN" :
cd "."
$(MAKE) /$(MAKEFLAGS) /F ".\mod_cache.mak" CFG="mod_cache - Win32 Debug" RECURSE=1 CLEAN
cd "."
!ENDIF
SOURCE=..\..\build\win32\httpd.rc
!IF "$(CFG)" == "mod_cache_disk - Win32 Release"
"$(INTDIR)\mod_cache_disk.res" : $(SOURCE) "$(INTDIR)"
$(RSC) /l 0x409 /fo"$(INTDIR)\mod_cache_disk.res" /i "../../include" /i "../../srclib/apr/include" /i "../../build\win32" /d "NDEBUG" /d BIN_NAME="mod_cache_disk.so" /d LONG_NAME="cache_disk_module for Apache" $(SOURCE)
!ELSEIF "$(CFG)" == "mod_cache_disk - Win32 Debug"
"$(INTDIR)\mod_cache_disk.res" : $(SOURCE) "$(INTDIR)"
$(RSC) /l 0x409 /fo"$(INTDIR)\mod_cache_disk.res" /i "../../include" /i "../../srclib/apr/include" /i "../../build\win32" /d "_DEBUG" /d BIN_NAME="mod_cache_disk.so" /d LONG_NAME="cache_disk_module for Apache" $(SOURCE)
!ENDIF
SOURCE=.\mod_cache_disk.c
"$(INTDIR)\mod_cache_disk.obj" : $(SOURCE) "$(INTDIR)"
!ENDIF

1545
modules/cache/mod_cache_socache.c vendored Normal file

File diff suppressed because it is too large Load diff

67
modules/cache/mod_cache_socache.dep vendored Normal file
View file

@ -0,0 +1,67 @@
# Microsoft Developer Studio Generated Dependency File, included by mod_cache_socache.mak
..\..\build\win32\httpd.rc : \
"..\..\include\ap_release.h"\
.\mod_cache_socache.c : \
"..\..\include\ap_config.h"\
"..\..\include\ap_config_layout.h"\
"..\..\include\ap_expr.h"\
"..\..\include\ap_hooks.h"\
"..\..\include\ap_mmn.h"\
"..\..\include\ap_provider.h"\
"..\..\include\ap_regex.h"\
"..\..\include\ap_release.h"\
"..\..\include\ap_socache.h"\
"..\..\include\apache_noprobes.h"\
"..\..\include\http_config.h"\
"..\..\include\http_core.h"\
"..\..\include\http_log.h"\
"..\..\include\http_protocol.h"\
"..\..\include\httpd.h"\
"..\..\include\os.h"\
"..\..\include\util_cfgtree.h"\
"..\..\include\util_charset.h"\
"..\..\include\util_filter.h"\
"..\..\include\util_mutex.h"\
"..\..\include\util_script.h"\
"..\..\srclib\apr-util\include\apr_buckets.h"\
"..\..\srclib\apr-util\include\apr_date.h"\
"..\..\srclib\apr-util\include\apr_hooks.h"\
"..\..\srclib\apr-util\include\apr_optional.h"\
"..\..\srclib\apr-util\include\apr_optional_hooks.h"\
"..\..\srclib\apr-util\include\apr_uri.h"\
"..\..\srclib\apr-util\include\apr_xlate.h"\
"..\..\srclib\apr-util\include\apu.h"\
"..\..\srclib\apr\include\apr.h"\
"..\..\srclib\apr\include\apr_allocator.h"\
"..\..\srclib\apr\include\apr_dso.h"\
"..\..\srclib\apr\include\apr_errno.h"\
"..\..\srclib\apr\include\apr_file_info.h"\
"..\..\srclib\apr\include\apr_file_io.h"\
"..\..\srclib\apr\include\apr_general.h"\
"..\..\srclib\apr\include\apr_global_mutex.h"\
"..\..\srclib\apr\include\apr_hash.h"\
"..\..\srclib\apr\include\apr_inherit.h"\
"..\..\srclib\apr\include\apr_lib.h"\
"..\..\srclib\apr\include\apr_mmap.h"\
"..\..\srclib\apr\include\apr_network_io.h"\
"..\..\srclib\apr\include\apr_poll.h"\
"..\..\srclib\apr\include\apr_pools.h"\
"..\..\srclib\apr\include\apr_portable.h"\
"..\..\srclib\apr\include\apr_proc_mutex.h"\
"..\..\srclib\apr\include\apr_ring.h"\
"..\..\srclib\apr\include\apr_shm.h"\
"..\..\srclib\apr\include\apr_strings.h"\
"..\..\srclib\apr\include\apr_tables.h"\
"..\..\srclib\apr\include\apr_thread_mutex.h"\
"..\..\srclib\apr\include\apr_thread_proc.h"\
"..\..\srclib\apr\include\apr_time.h"\
"..\..\srclib\apr\include\apr_user.h"\
"..\..\srclib\apr\include\apr_want.h"\
"..\generators\mod_status.h"\
".\cache_common.h"\
".\cache_socache_common.h"\
".\mod_cache.h"\

115
modules/cache/mod_cache_socache.dsp vendored Normal file
View file

@ -0,0 +1,115 @@
# Microsoft Developer Studio Project File - Name="mod_cache_socache" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=mod_cache_socache - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "mod_cache_socache.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "mod_cache_socache.mak" CFG="mod_cache_socache - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "mod_cache_socache - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "mod_cache_socache - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "mod_cache_socache - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../../srclib/apr-util/include" /I "../../srclib/apr/include" /I "../../include" /I "../generators" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Fd"Release\mod_cache_socache_src" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /fo"Release/mod_cache_socache.res" /i "../../include" /i "../../srclib/apr/include" /d "NDEBUG" /d BIN_NAME="mod_cache_socache.so" /d LONG_NAME="cache_socache_module for Apache"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll
# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_cache_socache.so" /base:@..\..\os\win32\BaseAddr.ref,mod_cache_socache.so /opt:ref
# Begin Special Build Tool
TargetPath=.\Release\mod_cache_socache.so
SOURCE="$(InputPath)"
PostBuild_Desc=Embed .manifest
PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2
# End Special Build Tool
!ELSEIF "$(CFG)" == "mod_cache_socache - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c
# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../../srclib/apr-util/include" /I "../../srclib/apr/include" /I "../../include" /I "../generators" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /Fd"Debug\mod_cache_socache_src" /FD /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /fo"Debug/mod_cache_socache.res" /i "../../include" /i "../../srclib/apr/include" /d "_DEBUG" /d BIN_NAME="mod_cache_socache.so" /d LONG_NAME="cache_socache_module for Apache"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug
# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_cache_socache.so" /base:@..\..\os\win32\BaseAddr.ref,mod_cache_socache.so
# Begin Special Build Tool
TargetPath=.\Debug\mod_cache_socache.so
SOURCE="$(InputPath)"
PostBuild_Desc=Embed .manifest
PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2
# End Special Build Tool
!ENDIF
# Begin Target
# Name "mod_cache_socache - Win32 Release"
# Name "mod_cache_socache - Win32 Debug"
# Begin Source File
SOURCE=.\mod_cache.h
# End Source File
# Begin Source File
SOURCE=.\mod_cache_socache.c
# End Source File
# Begin Source File
SOURCE=..\..\build\win32\httpd.rc
# End Source File
# End Target
# End Project

381
modules/cache/mod_cache_socache.mak vendored Normal file
View file

@ -0,0 +1,381 @@
# Microsoft Developer Studio Generated NMAKE File, Based on mod_cache_socache.dsp
!IF "$(CFG)" == ""
CFG=mod_cache_socache - Win32 Debug
!MESSAGE No configuration specified. Defaulting to mod_cache_socache - Win32 Debug.
!ENDIF
!IF "$(CFG)" != "mod_cache_socache - Win32 Release" && "$(CFG)" != "mod_cache_socache - Win32 Debug"
!MESSAGE Invalid configuration "$(CFG)" specified.
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "mod_cache_socache.mak" CFG="mod_cache_socache - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "mod_cache_socache - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "mod_cache_socache - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
!ERROR An invalid configuration is specified.
!ENDIF
!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF
!IF "$(CFG)" == "mod_cache_socache - Win32 Release"
OUTDIR=.\Release
INTDIR=.\Release
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
# Begin Custom Macros
OutDir=.\Release
# End Custom Macros
!IF "$(RECURSE)" == "0"
ALL : "$(OUTDIR)\mod_cache_socache.so" "$(DS_POSTBUILD_DEP)"
!ELSE
ALL : "mod_cache - Win32 Release" "libhttpd - Win32 Release" "libaprutil - Win32 Release" "libapr - Win32 Release" "$(OUTDIR)\mod_cache_socache.so" "$(DS_POSTBUILD_DEP)"
!ENDIF
!IF "$(RECURSE)" == "1"
CLEAN :"libapr - Win32 ReleaseCLEAN" "libaprutil - Win32 ReleaseCLEAN" "libhttpd - Win32 ReleaseCLEAN" "mod_cache - Win32 ReleaseCLEAN"
!ELSE
CLEAN :
!ENDIF
-@erase "$(INTDIR)\mod_cache_socache.obj"
-@erase "$(INTDIR)\mod_cache_socache.res"
-@erase "$(INTDIR)\mod_cache_socache_src.idb"
-@erase "$(INTDIR)\mod_cache_socache_src.pdb"
-@erase "$(OUTDIR)\mod_cache_socache.exp"
-@erase "$(OUTDIR)\mod_cache_socache.lib"
-@erase "$(OUTDIR)\mod_cache_socache.pdb"
-@erase "$(OUTDIR)\mod_cache_socache.so"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP=cl.exe
CPP_PROJ=/nologo /MD /W3 /Zi /O2 /Oy- /I "../../srclib/apr-util/include" /I "../../srclib/apr/include" /I "../../include" /I "../generators" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\mod_cache_socache_src" /FD /c
.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
MTL=midl.exe
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
RSC=rc.exe
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\mod_cache_socache.res" /i "../../include" /i "../../srclib/apr/include" /d "NDEBUG" /d BIN_NAME="mod_cache_socache.so" /d LONG_NAME="cache_socache_module for Apache"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\mod_cache_socache.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=kernel32.lib /nologo /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\mod_cache_socache.pdb" /debug /out:"$(OUTDIR)\mod_cache_socache.so" /implib:"$(OUTDIR)\mod_cache_socache.lib" /base:@..\..\os\win32\BaseAddr.ref,mod_cache_socache.so /opt:ref
LINK32_OBJS= \
"$(INTDIR)\mod_cache_socache.obj" \
"$(INTDIR)\mod_cache_socache.res" \
"..\..\srclib\apr\Release\libapr-1.lib" \
"..\..\srclib\apr-util\Release\libaprutil-1.lib" \
"..\..\Release\libhttpd.lib" \
"$(OUTDIR)\mod_cache.lib"
"$(OUTDIR)\mod_cache_socache.so" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
TargetPath=.\Release\mod_cache_socache.so
SOURCE="$(InputPath)"
PostBuild_Desc=Embed .manifest
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
# Begin Custom Macros
OutDir=.\Release
# End Custom Macros
"$(DS_POSTBUILD_DEP)" : "$(OUTDIR)\mod_cache_socache.so"
if exist .\Release\mod_cache_socache.so.manifest mt.exe -manifest .\Release\mod_cache_socache.so.manifest -outputresource:.\Release\mod_cache_socache.so;2
echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)"
!ELSEIF "$(CFG)" == "mod_cache_socache - Win32 Debug"
OUTDIR=.\Debug
INTDIR=.\Debug
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
# Begin Custom Macros
OutDir=.\Debug
# End Custom Macros
!IF "$(RECURSE)" == "0"
ALL : "$(OUTDIR)\mod_cache_socache.so" "$(DS_POSTBUILD_DEP)"
!ELSE
ALL : "mod_cache - Win32 Debug" "libhttpd - Win32 Debug" "libaprutil - Win32 Debug" "libapr - Win32 Debug" "$(OUTDIR)\mod_cache_socache.so" "$(DS_POSTBUILD_DEP)"
!ENDIF
!IF "$(RECURSE)" == "1"
CLEAN :"libapr - Win32 DebugCLEAN" "libaprutil - Win32 DebugCLEAN" "libhttpd - Win32 DebugCLEAN" "mod_cache - Win32 DebugCLEAN"
!ELSE
CLEAN :
!ENDIF
-@erase "$(INTDIR)\mod_cache_socache.obj"
-@erase "$(INTDIR)\mod_cache_socache.res"
-@erase "$(INTDIR)\mod_cache_socache_src.idb"
-@erase "$(INTDIR)\mod_cache_socache_src.pdb"
-@erase "$(OUTDIR)\mod_cache_socache.exp"
-@erase "$(OUTDIR)\mod_cache_socache.lib"
-@erase "$(OUTDIR)\mod_cache_socache.pdb"
-@erase "$(OUTDIR)\mod_cache_socache.so"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP=cl.exe
CPP_PROJ=/nologo /MDd /W3 /Zi /Od /I "../../srclib/apr-util/include" /I "../../srclib/apr/include" /I "../../include" /I "../generators" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\mod_cache_socache_src" /FD /EHsc /c
.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
MTL=midl.exe
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
RSC=rc.exe
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\mod_cache_socache.res" /i "../../include" /i "../../srclib/apr/include" /d "_DEBUG" /d BIN_NAME="mod_cache_socache.so" /d LONG_NAME="cache_socache_module for Apache"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\mod_cache_socache.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=kernel32.lib /nologo /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\mod_cache_socache.pdb" /debug /out:"$(OUTDIR)\mod_cache_socache.so" /implib:"$(OUTDIR)\mod_cache_socache.lib" /base:@..\..\os\win32\BaseAddr.ref,mod_cache_socache.so
LINK32_OBJS= \
"$(INTDIR)\mod_cache_socache.obj" \
"$(INTDIR)\mod_cache_socache.res" \
"..\..\srclib\apr\Debug\libapr-1.lib" \
"..\..\srclib\apr-util\Debug\libaprutil-1.lib" \
"..\..\Debug\libhttpd.lib" \
"$(OUTDIR)\mod_cache.lib"
"$(OUTDIR)\mod_cache_socache.so" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
TargetPath=.\Debug\mod_cache_socache.so
SOURCE="$(InputPath)"
PostBuild_Desc=Embed .manifest
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
# Begin Custom Macros
OutDir=.\Debug
# End Custom Macros
"$(DS_POSTBUILD_DEP)" : "$(OUTDIR)\mod_cache_socache.so"
if exist .\Debug\mod_cache_socache.so.manifest mt.exe -manifest .\Debug\mod_cache_socache.so.manifest -outputresource:.\Debug\mod_cache_socache.so;2
echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)"
!ENDIF
!IF "$(NO_EXTERNAL_DEPS)" != "1"
!IF EXISTS("mod_cache_socache.dep")
!INCLUDE "mod_cache_socache.dep"
!ELSE
!MESSAGE Warning: cannot find "mod_cache_socache.dep"
!ENDIF
!ENDIF
!IF "$(CFG)" == "mod_cache_socache - Win32 Release" || "$(CFG)" == "mod_cache_socache - Win32 Debug"
!IF "$(CFG)" == "mod_cache_socache - Win32 Release"
"libapr - Win32 Release" :
cd ".\..\..\srclib\apr"
$(MAKE) /$(MAKEFLAGS) /F ".\libapr.mak" CFG="libapr - Win32 Release"
cd "..\..\modules\cache"
"libapr - Win32 ReleaseCLEAN" :
cd ".\..\..\srclib\apr"
$(MAKE) /$(MAKEFLAGS) /F ".\libapr.mak" CFG="libapr - Win32 Release" RECURSE=1 CLEAN
cd "..\..\modules\cache"
!ELSEIF "$(CFG)" == "mod_cache_socache - Win32 Debug"
"libapr - Win32 Debug" :
cd ".\..\..\srclib\apr"
$(MAKE) /$(MAKEFLAGS) /F ".\libapr.mak" CFG="libapr - Win32 Debug"
cd "..\..\modules\cache"
"libapr - Win32 DebugCLEAN" :
cd ".\..\..\srclib\apr"
$(MAKE) /$(MAKEFLAGS) /F ".\libapr.mak" CFG="libapr - Win32 Debug" RECURSE=1 CLEAN
cd "..\..\modules\cache"
!ENDIF
!IF "$(CFG)" == "mod_cache_socache - Win32 Release"
"libaprutil - Win32 Release" :
cd ".\..\..\srclib\apr-util"
$(MAKE) /$(MAKEFLAGS) /F ".\libaprutil.mak" CFG="libaprutil - Win32 Release"
cd "..\..\modules\cache"
"libaprutil - Win32 ReleaseCLEAN" :
cd ".\..\..\srclib\apr-util"
$(MAKE) /$(MAKEFLAGS) /F ".\libaprutil.mak" CFG="libaprutil - Win32 Release" RECURSE=1 CLEAN
cd "..\..\modules\cache"
!ELSEIF "$(CFG)" == "mod_cache_socache - Win32 Debug"
"libaprutil - Win32 Debug" :
cd ".\..\..\srclib\apr-util"
$(MAKE) /$(MAKEFLAGS) /F ".\libaprutil.mak" CFG="libaprutil - Win32 Debug"
cd "..\..\modules\cache"
"libaprutil - Win32 DebugCLEAN" :
cd ".\..\..\srclib\apr-util"
$(MAKE) /$(MAKEFLAGS) /F ".\libaprutil.mak" CFG="libaprutil - Win32 Debug" RECURSE=1 CLEAN
cd "..\..\modules\cache"
!ENDIF
!IF "$(CFG)" == "mod_cache_socache - Win32 Release"
"libhttpd - Win32 Release" :
cd ".\..\.."
$(MAKE) /$(MAKEFLAGS) /F ".\libhttpd.mak" CFG="libhttpd - Win32 Release"
cd ".\modules\cache"
"libhttpd - Win32 ReleaseCLEAN" :
cd ".\..\.."
$(MAKE) /$(MAKEFLAGS) /F ".\libhttpd.mak" CFG="libhttpd - Win32 Release" RECURSE=1 CLEAN
cd ".\modules\cache"
!ELSEIF "$(CFG)" == "mod_cache_socache - Win32 Debug"
"libhttpd - Win32 Debug" :
cd ".\..\.."
$(MAKE) /$(MAKEFLAGS) /F ".\libhttpd.mak" CFG="libhttpd - Win32 Debug"
cd ".\modules\cache"
"libhttpd - Win32 DebugCLEAN" :
cd ".\..\.."
$(MAKE) /$(MAKEFLAGS) /F ".\libhttpd.mak" CFG="libhttpd - Win32 Debug" RECURSE=1 CLEAN
cd ".\modules\cache"
!ENDIF
!IF "$(CFG)" == "mod_cache_socache - Win32 Release"
"mod_cache - Win32 Release" :
cd "."
$(MAKE) /$(MAKEFLAGS) /F ".\mod_cache.mak" CFG="mod_cache - Win32 Release"
cd "."
"mod_cache - Win32 ReleaseCLEAN" :
cd "."
$(MAKE) /$(MAKEFLAGS) /F ".\mod_cache.mak" CFG="mod_cache - Win32 Release" RECURSE=1 CLEAN
cd "."
!ELSEIF "$(CFG)" == "mod_cache_socache - Win32 Debug"
"mod_cache - Win32 Debug" :
cd "."
$(MAKE) /$(MAKEFLAGS) /F ".\mod_cache.mak" CFG="mod_cache - Win32 Debug"
cd "."
"mod_cache - Win32 DebugCLEAN" :
cd "."
$(MAKE) /$(MAKEFLAGS) /F ".\mod_cache.mak" CFG="mod_cache - Win32 Debug" RECURSE=1 CLEAN
cd "."
!ENDIF
SOURCE=..\..\build\win32\httpd.rc
!IF "$(CFG)" == "mod_cache_socache - Win32 Release"
"$(INTDIR)\mod_cache_socache.res" : $(SOURCE) "$(INTDIR)"
$(RSC) /l 0x409 /fo"$(INTDIR)\mod_cache_socache.res" /i "../../include" /i "../../srclib/apr/include" /i "../../build\win32" /d "NDEBUG" /d BIN_NAME="mod_cache_socache.so" /d LONG_NAME="cache_socache_module for Apache" $(SOURCE)
!ELSEIF "$(CFG)" == "mod_cache_socache - Win32 Debug"
"$(INTDIR)\mod_cache_socache.res" : $(SOURCE) "$(INTDIR)"
$(RSC) /l 0x409 /fo"$(INTDIR)\mod_cache_socache.res" /i "../../include" /i "../../srclib/apr/include" /i "../../build\win32" /d "_DEBUG" /d BIN_NAME="mod_cache_socache.so" /d LONG_NAME="cache_socache_module for Apache" $(SOURCE)
!ENDIF
SOURCE=.\mod_cache_socache.c
"$(INTDIR)\mod_cache_socache.obj" : $(SOURCE) "$(INTDIR)"
!ENDIF

414
modules/cache/mod_file_cache.c vendored Normal file
View file

@ -0,0 +1,414 @@
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Author: mod_file_cache by Bill Stoddard <stoddard apache.org>
* Based on mod_mmap_static by Dean Gaudet <dgaudet arctic.org>
*
* v0.01: initial implementation
*/
/*
Documentation:
Some sites have a set of static files that are really busy, and
change infrequently (or even on a regular schedule). Save time
by caching open handles to these files. This module, unlike
mod_mmap_static, caches open file handles, not file content.
On systems (like Windows) with heavy system call overhead and
that have an efficient sendfile implementation, caching file handles
offers several advantages over caching content. First, the file system
can manage the memory, allowing infrequently hit cached files to
be paged out. Second, since caching open handles does not consume
significant resources, it will be possible to enable an AutoLoadCache
feature where static files are dynamically loaded in the cache
as the server runs. On systems that have file change notification,
this module can be enhanced to automatically garbage collect
cached files that change on disk.
This module should work on Unix systems that have sendfile. Place
cachefile directives into your configuration to direct files to
be cached.
cachefile /path/to/file1
cachefile /path/to/file2
...
These files are only cached when the server is restarted, so if you
change the list, or if the files are changed, then you'll need to
restart the server.
To reiterate that point: if the files are modified *in place*
without restarting the server you may end up serving requests that
are completely bogus. You should update files by unlinking the old
copy and putting a new copy in place.
There's no such thing as inheriting these files across vhosts or
whatever... place the directives in the main server only.
Known problems:
Don't use Alias or RewriteRule to move these files around... unless
you feel like paying for an extra stat() on each request. This is
a deficiency in the Apache API that will hopefully be solved some day.
The file will be served out of the file handle cache, but there will be
an extra stat() that's a waste.
*/
#include "apr.h"
#if !(APR_HAS_SENDFILE || APR_HAS_MMAP)
#error mod_file_cache only works on systems with APR_HAS_SENDFILE or APR_HAS_MMAP
#endif
#include "apr_mmap.h"
#include "apr_strings.h"
#include "apr_hash.h"
#include "apr_buckets.h"
#define APR_WANT_STRFUNC
#include "apr_want.h"
#if APR_HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include "httpd.h"
#include "http_config.h"
#include "http_log.h"
#include "http_protocol.h"
#include "http_request.h"
#include "http_core.h"
module AP_MODULE_DECLARE_DATA file_cache_module;
typedef struct {
#if APR_HAS_SENDFILE
apr_file_t *file;
#endif
const char *filename;
apr_finfo_t finfo;
int is_mmapped;
#if APR_HAS_MMAP
apr_mmap_t *mm;
#endif
char mtimestr[APR_RFC822_DATE_LEN];
char sizestr[21]; /* big enough to hold any 64-bit file size + null */
} a_file;
typedef struct {
apr_hash_t *fileht;
} a_server_config;
static void *create_server_config(apr_pool_t *p, server_rec *s)
{
a_server_config *sconf = apr_palloc(p, sizeof(*sconf));
sconf->fileht = apr_hash_make(p);
return sconf;
}
static void cache_the_file(cmd_parms *cmd, const char *filename, int mmap)
{
a_server_config *sconf;
a_file *new_file;
a_file tmp;
apr_file_t *fd = NULL;
apr_status_t rc;
const char *fspec;
fspec = ap_server_root_relative(cmd->pool, filename);
if (!fspec) {
ap_log_error(APLOG_MARK, APLOG_WARNING, APR_EBADPATH, cmd->server, APLOGNO(00794)
"invalid file path "
"%s, skipping", filename);
return;
}
if ((rc = apr_stat(&tmp.finfo, fspec, APR_FINFO_MIN,
cmd->temp_pool)) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_WARNING, rc, cmd->server, APLOGNO(00795)
"unable to stat(%s), skipping", fspec);
return;
}
if (tmp.finfo.filetype != APR_REG) {
ap_log_error(APLOG_MARK, APLOG_WARNING, 0, cmd->server, APLOGNO(00796)
"%s isn't a regular file, skipping", fspec);
return;
}
if (tmp.finfo.size > AP_MAX_SENDFILE) {
ap_log_error(APLOG_MARK, APLOG_WARNING, 0, cmd->server, APLOGNO(00797)
"%s is too large to cache, skipping", fspec);
return;
}
rc = apr_file_open(&fd, fspec, APR_READ | APR_BINARY | APR_XTHREAD,
APR_OS_DEFAULT, cmd->pool);
if (rc != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_WARNING, rc, cmd->server, APLOGNO(00798)
"unable to open(%s, O_RDONLY), skipping", fspec);
return;
}
apr_file_inherit_set(fd);
/* WooHoo, we have a file to put in the cache */
new_file = apr_pcalloc(cmd->pool, sizeof(a_file));
new_file->finfo = tmp.finfo;
#if APR_HAS_MMAP
if (mmap) {
/* MMAPFile directive. MMAP'ing the file
* XXX: APR_HAS_LARGE_FILES issue; need to reject this request if
* size is greater than MAX(apr_size_t) (perhaps greater than 1M?).
*/
if ((rc = apr_mmap_create(&new_file->mm, fd, 0,
(apr_size_t)new_file->finfo.size,
APR_MMAP_READ, cmd->pool)) != APR_SUCCESS) {
apr_file_close(fd);
ap_log_error(APLOG_MARK, APLOG_WARNING, rc, cmd->server, APLOGNO(00799)
"unable to mmap %s, skipping", filename);
return;
}
apr_file_close(fd);
new_file->is_mmapped = TRUE;
}
#endif
#if APR_HAS_SENDFILE
if (!mmap) {
/* CacheFile directive. Caching the file handle */
new_file->is_mmapped = FALSE;
new_file->file = fd;
}
#endif
new_file->filename = fspec;
apr_rfc822_date(new_file->mtimestr, new_file->finfo.mtime);
apr_snprintf(new_file->sizestr, sizeof new_file->sizestr, "%" APR_OFF_T_FMT, new_file->finfo.size);
sconf = ap_get_module_config(cmd->server->module_config, &file_cache_module);
apr_hash_set(sconf->fileht, new_file->filename, strlen(new_file->filename), new_file);
}
static const char *cachefilehandle(cmd_parms *cmd, void *dummy, const char *filename)
{
#if APR_HAS_SENDFILE
cache_the_file(cmd, filename, 0);
#else
/* Sendfile not supported by this OS */
ap_log_error(APLOG_MARK, APLOG_WARNING, 0, cmd->server, APLOGNO(00800)
"unable to cache file: %s. Sendfile is not supported on this OS", filename);
#endif
return NULL;
}
static const char *cachefilemmap(cmd_parms *cmd, void *dummy, const char *filename)
{
#if APR_HAS_MMAP
cache_the_file(cmd, filename, 1);
#else
/* MMAP not supported by this OS */
ap_log_error(APLOG_MARK, APLOG_WARNING, 0, cmd->server, APLOGNO(00801)
"unable to cache file: %s. MMAP is not supported by this OS", filename);
#endif
return NULL;
}
static int file_cache_post_config(apr_pool_t *p, apr_pool_t *plog,
apr_pool_t *ptemp, server_rec *s)
{
/* Hummm, anything to do here? */
return OK;
}
/* If it's one of ours, fill in r->finfo now to avoid extra stat()... this is a
* bit of a kludge, because we really want to run after core_translate runs.
*/
static int file_cache_xlat(request_rec *r)
{
a_server_config *sconf;
a_file *match;
int res;
sconf = ap_get_module_config(r->server->module_config, &file_cache_module);
/* we only operate when at least one cachefile directive was used */
if (!apr_hash_count(sconf->fileht)) {
return DECLINED;
}
res = ap_core_translate(r);
if (res != OK || !r->filename) {
return res;
}
/* search the cache */
match = (a_file *) apr_hash_get(sconf->fileht, r->filename, APR_HASH_KEY_STRING);
if (match == NULL)
return DECLINED;
/* pass search results to handler */
ap_set_module_config(r->request_config, &file_cache_module, match);
/* shortcircuit the get_path_info() stat() calls and stuff */
r->finfo = match->finfo;
return OK;
}
static int mmap_handler(request_rec *r, a_file *file)
{
#if APR_HAS_MMAP
conn_rec *c = r->connection;
apr_bucket *b;
apr_mmap_t *mm;
apr_bucket_brigade *bb = apr_brigade_create(r->pool, c->bucket_alloc);
apr_mmap_dup(&mm, file->mm, r->pool);
b = apr_bucket_mmap_create(mm, 0, (apr_size_t)file->finfo.size,
c->bucket_alloc);
APR_BRIGADE_INSERT_TAIL(bb, b);
b = apr_bucket_eos_create(c->bucket_alloc);
APR_BRIGADE_INSERT_TAIL(bb, b);
if (ap_pass_brigade(r->output_filters, bb) != APR_SUCCESS)
return AP_FILTER_ERROR;
#endif
return OK;
}
static int sendfile_handler(request_rec *r, a_file *file)
{
#if APR_HAS_SENDFILE
conn_rec *c = r->connection;
apr_bucket *b;
apr_bucket_brigade *bb = apr_brigade_create(r->pool, c->bucket_alloc);
apr_brigade_insert_file(bb, file->file, 0, file->finfo.size, r->pool);
b = apr_bucket_eos_create(c->bucket_alloc);
APR_BRIGADE_INSERT_TAIL(bb, b);
if (ap_pass_brigade(r->output_filters, bb) != APR_SUCCESS)
return AP_FILTER_ERROR;
#endif
return OK;
}
static int file_cache_handler(request_rec *r)
{
a_file *match;
int errstatus;
int rc = OK;
/* Bail out if r->handler isn't the default value, and doesn't look like a Content-Type
* XXX: Even though we made the user explicitly list each path to cache?
*/
if (ap_strcmp_match(r->handler, "*/*") && !AP_IS_DEFAULT_HANDLER_NAME(r->handler)) {
return DECLINED;
}
/* we don't handle anything but GET */
if (r->method_number != M_GET) return DECLINED;
/* did xlat phase find the file? */
match = ap_get_module_config(r->request_config, &file_cache_module);
if (match == NULL) {
return DECLINED;
}
/* note that we would handle GET on this resource */
r->allowed |= (AP_METHOD_BIT << M_GET);
/* This handler has no use for a request body (yet), but we still
* need to read and discard it if the client sent one.
*/
if ((errstatus = ap_discard_request_body(r)) != OK)
return errstatus;
ap_update_mtime(r, match->finfo.mtime);
/* ap_set_last_modified() always converts the file mtime to a string
* which is slow. Accelerate the common case.
* ap_set_last_modified(r);
*/
{
apr_time_t mod_time;
char *datestr;
mod_time = ap_rationalize_mtime(r, r->mtime);
if (mod_time == match->finfo.mtime)
datestr = match->mtimestr;
else {
datestr = apr_palloc(r->pool, APR_RFC822_DATE_LEN);
apr_rfc822_date(datestr, mod_time);
}
apr_table_setn(r->headers_out, "Last-Modified", datestr);
}
/* ap_set_content_length() always converts the same number and never
* returns an error. Accelerate it.
*/
r->clength = match->finfo.size;
apr_table_setn(r->headers_out, "Content-Length", match->sizestr);
ap_set_etag(r);
if ((errstatus = ap_meets_conditions(r)) != OK) {
return errstatus;
}
/* Call appropriate handler */
if (!r->header_only) {
if (match->is_mmapped == TRUE)
rc = mmap_handler(r, match);
else
rc = sendfile_handler(r, match);
}
return rc;
}
static const command_rec file_cache_cmds[] =
{
AP_INIT_ITERATE("cachefile", cachefilehandle, NULL, RSRC_CONF,
"A space separated list of files to add to the file handle cache at config time"),
AP_INIT_ITERATE("mmapfile", cachefilemmap, NULL, RSRC_CONF,
"A space separated list of files to mmap at config time"),
{NULL}
};
static void register_hooks(apr_pool_t *p)
{
ap_hook_handler(file_cache_handler, NULL, NULL, APR_HOOK_LAST);
ap_hook_post_config(file_cache_post_config, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_translate_name(file_cache_xlat, NULL, NULL, APR_HOOK_MIDDLE);
/* This trick doesn't work apparently because the translate hooks
are single shot. If the core_hook returns OK, then our hook is
not called.
ap_hook_translate_name(file_cache_xlat, aszPre, NULL, APR_HOOK_MIDDLE);
*/
}
AP_DECLARE_MODULE(file_cache) =
{
STANDARD20_MODULE_STUFF,
NULL, /* create per-directory config structure */
NULL, /* merge per-directory config structures */
create_server_config, /* create per-server config structure */
NULL, /* merge per-server config structures */
file_cache_cmds, /* command handlers */
register_hooks /* register hooks */
};

56
modules/cache/mod_file_cache.dep vendored Normal file
View file

@ -0,0 +1,56 @@
# Microsoft Developer Studio Generated Dependency File, included by mod_file_cache.mak
..\..\build\win32\httpd.rc : \
"..\..\include\ap_release.h"\
.\mod_file_cache.c : \
"..\..\include\ap_config.h"\
"..\..\include\ap_config_layout.h"\
"..\..\include\ap_expr.h"\
"..\..\include\ap_hooks.h"\
"..\..\include\ap_mmn.h"\
"..\..\include\ap_regex.h"\
"..\..\include\ap_release.h"\
"..\..\include\apache_noprobes.h"\
"..\..\include\http_config.h"\
"..\..\include\http_core.h"\
"..\..\include\http_log.h"\
"..\..\include\http_protocol.h"\
"..\..\include\http_request.h"\
"..\..\include\httpd.h"\
"..\..\include\os.h"\
"..\..\include\util_cfgtree.h"\
"..\..\include\util_filter.h"\
"..\..\srclib\apr-util\include\apr_buckets.h"\
"..\..\srclib\apr-util\include\apr_hooks.h"\
"..\..\srclib\apr-util\include\apr_optional.h"\
"..\..\srclib\apr-util\include\apr_optional_hooks.h"\
"..\..\srclib\apr-util\include\apr_uri.h"\
"..\..\srclib\apr-util\include\apu.h"\
"..\..\srclib\apr\include\apr.h"\
"..\..\srclib\apr\include\apr_allocator.h"\
"..\..\srclib\apr\include\apr_dso.h"\
"..\..\srclib\apr\include\apr_errno.h"\
"..\..\srclib\apr\include\apr_file_info.h"\
"..\..\srclib\apr\include\apr_file_io.h"\
"..\..\srclib\apr\include\apr_general.h"\
"..\..\srclib\apr\include\apr_global_mutex.h"\
"..\..\srclib\apr\include\apr_hash.h"\
"..\..\srclib\apr\include\apr_inherit.h"\
"..\..\srclib\apr\include\apr_mmap.h"\
"..\..\srclib\apr\include\apr_network_io.h"\
"..\..\srclib\apr\include\apr_poll.h"\
"..\..\srclib\apr\include\apr_pools.h"\
"..\..\srclib\apr\include\apr_portable.h"\
"..\..\srclib\apr\include\apr_proc_mutex.h"\
"..\..\srclib\apr\include\apr_ring.h"\
"..\..\srclib\apr\include\apr_shm.h"\
"..\..\srclib\apr\include\apr_strings.h"\
"..\..\srclib\apr\include\apr_tables.h"\
"..\..\srclib\apr\include\apr_thread_mutex.h"\
"..\..\srclib\apr\include\apr_thread_proc.h"\
"..\..\srclib\apr\include\apr_time.h"\
"..\..\srclib\apr\include\apr_user.h"\
"..\..\srclib\apr\include\apr_want.h"\

111
modules/cache/mod_file_cache.dsp vendored Normal file
View file

@ -0,0 +1,111 @@
# Microsoft Developer Studio Project File - Name="mod_file_cache" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=mod_file_cache - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "mod_file_cache.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "mod_file_cache.mak" CFG="mod_file_cache - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "mod_file_cache - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "mod_file_cache - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "mod_file_cache - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Release\mod_file_cache_src" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL"
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL"
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /fo"Release/mod_file_cache.res" /i "../../include" /i "../../srclib/apr/include" /d "NDEBUG" /d BIN_NAME="mod_file_cache.so" /d LONG_NAME="file_cache_module for Apache"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 /nologo /subsystem:windows /dll /out:".\Release\mod_file_cache.so" /base:@..\..\os\win32\BaseAddr.ref,mod_file_cache.so
# ADD LINK32 /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_file_cache.so" /base:@..\..\os\win32\BaseAddr.ref,mod_file_cache.so /opt:ref
# Begin Special Build Tool
TargetPath=.\Release\mod_file_cache.so
SOURCE="$(InputPath)"
PostBuild_Desc=Embed .manifest
PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2
# End Special Build Tool
!ELSEIF "$(CFG)" == "mod_file_cache - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c
# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Debug\mod_file_cache_src" /FD /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL"
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL"
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /fo"Debug/mod_file_cache.res" /i "../../include" /i "../../srclib/apr/include" /d "_DEBUG" /d BIN_NAME="mod_file_cache.so" /d LONG_NAME="file_cache_module for Apache"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_file_cache.so" /base:@..\..\os\win32\BaseAddr.ref,mod_file_cache.so
# ADD LINK32 /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_file_cache.so" /base:@..\..\os\win32\BaseAddr.ref,mod_file_cache.so
# Begin Special Build Tool
TargetPath=.\Debug\mod_file_cache.so
SOURCE="$(InputPath)"
PostBuild_Desc=Embed .manifest
PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2
# End Special Build Tool
!ENDIF
# Begin Target
# Name "mod_file_cache - Win32 Release"
# Name "mod_file_cache - Win32 Debug"
# Begin Source File
SOURCE=.\mod_file_cache.c
# End Source File
# Begin Source File
SOURCE=..\..\build\win32\httpd.rc
# End Source File
# End Target
# End Project

1
modules/cache/mod_file_cache.exp vendored Normal file
View file

@ -0,0 +1 @@
file_cache_module

353
modules/cache/mod_file_cache.mak vendored Normal file
View file

@ -0,0 +1,353 @@
# Microsoft Developer Studio Generated NMAKE File, Based on mod_file_cache.dsp
!IF "$(CFG)" == ""
CFG=mod_file_cache - Win32 Debug
!MESSAGE No configuration specified. Defaulting to mod_file_cache - Win32 Debug.
!ENDIF
!IF "$(CFG)" != "mod_file_cache - Win32 Release" && "$(CFG)" != "mod_file_cache - Win32 Debug"
!MESSAGE Invalid configuration "$(CFG)" specified.
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "mod_file_cache.mak" CFG="mod_file_cache - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "mod_file_cache - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "mod_file_cache - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
!ERROR An invalid configuration is specified.
!ENDIF
!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF
!IF "$(CFG)" == "mod_file_cache - Win32 Release"
OUTDIR=.\Release
INTDIR=.\Release
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
# Begin Custom Macros
OutDir=.\Release
# End Custom Macros
!IF "$(RECURSE)" == "0"
ALL : "$(OUTDIR)\mod_file_cache.so" "$(DS_POSTBUILD_DEP)"
!ELSE
ALL : "libhttpd - Win32 Release" "libaprutil - Win32 Release" "libapr - Win32 Release" "$(OUTDIR)\mod_file_cache.so" "$(DS_POSTBUILD_DEP)"
!ENDIF
!IF "$(RECURSE)" == "1"
CLEAN :"libapr - Win32 ReleaseCLEAN" "libaprutil - Win32 ReleaseCLEAN" "libhttpd - Win32 ReleaseCLEAN"
!ELSE
CLEAN :
!ENDIF
-@erase "$(INTDIR)\mod_file_cache.obj"
-@erase "$(INTDIR)\mod_file_cache.res"
-@erase "$(INTDIR)\mod_file_cache_src.idb"
-@erase "$(INTDIR)\mod_file_cache_src.pdb"
-@erase "$(OUTDIR)\mod_file_cache.exp"
-@erase "$(OUTDIR)\mod_file_cache.lib"
-@erase "$(OUTDIR)\mod_file_cache.pdb"
-@erase "$(OUTDIR)\mod_file_cache.so"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP=cl.exe
CPP_PROJ=/nologo /MD /W3 /Zi /O2 /Oy- /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\mod_file_cache_src" /FD /c
.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
MTL=midl.exe
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL"
RSC=rc.exe
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\mod_file_cache.res" /i "../../include" /i "../../srclib/apr/include" /d "NDEBUG" /d BIN_NAME="mod_file_cache.so" /d LONG_NAME="file_cache_module for Apache"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\mod_file_cache.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=/nologo /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\mod_file_cache.pdb" /debug /out:"$(OUTDIR)\mod_file_cache.so" /implib:"$(OUTDIR)\mod_file_cache.lib" /base:@..\..\os\win32\BaseAddr.ref,mod_file_cache.so /opt:ref
LINK32_OBJS= \
"$(INTDIR)\mod_file_cache.obj" \
"$(INTDIR)\mod_file_cache.res" \
"..\..\srclib\apr\Release\libapr-1.lib" \
"..\..\srclib\apr-util\Release\libaprutil-1.lib" \
"..\..\Release\libhttpd.lib"
"$(OUTDIR)\mod_file_cache.so" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
TargetPath=.\Release\mod_file_cache.so
SOURCE="$(InputPath)"
PostBuild_Desc=Embed .manifest
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
# Begin Custom Macros
OutDir=.\Release
# End Custom Macros
"$(DS_POSTBUILD_DEP)" : "$(OUTDIR)\mod_file_cache.so"
if exist .\Release\mod_file_cache.so.manifest mt.exe -manifest .\Release\mod_file_cache.so.manifest -outputresource:.\Release\mod_file_cache.so;2
echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)"
!ELSEIF "$(CFG)" == "mod_file_cache - Win32 Debug"
OUTDIR=.\Debug
INTDIR=.\Debug
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
# Begin Custom Macros
OutDir=.\Debug
# End Custom Macros
!IF "$(RECURSE)" == "0"
ALL : "$(OUTDIR)\mod_file_cache.so" "$(DS_POSTBUILD_DEP)"
!ELSE
ALL : "libhttpd - Win32 Debug" "libaprutil - Win32 Debug" "libapr - Win32 Debug" "$(OUTDIR)\mod_file_cache.so" "$(DS_POSTBUILD_DEP)"
!ENDIF
!IF "$(RECURSE)" == "1"
CLEAN :"libapr - Win32 DebugCLEAN" "libaprutil - Win32 DebugCLEAN" "libhttpd - Win32 DebugCLEAN"
!ELSE
CLEAN :
!ENDIF
-@erase "$(INTDIR)\mod_file_cache.obj"
-@erase "$(INTDIR)\mod_file_cache.res"
-@erase "$(INTDIR)\mod_file_cache_src.idb"
-@erase "$(INTDIR)\mod_file_cache_src.pdb"
-@erase "$(OUTDIR)\mod_file_cache.exp"
-@erase "$(OUTDIR)\mod_file_cache.lib"
-@erase "$(OUTDIR)\mod_file_cache.pdb"
-@erase "$(OUTDIR)\mod_file_cache.so"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP=cl.exe
CPP_PROJ=/nologo /MDd /W3 /Zi /Od /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\mod_file_cache_src" /FD /EHsc /c
.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
MTL=midl.exe
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL"
RSC=rc.exe
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\mod_file_cache.res" /i "../../include" /i "../../srclib/apr/include" /d "_DEBUG" /d BIN_NAME="mod_file_cache.so" /d LONG_NAME="file_cache_module for Apache"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\mod_file_cache.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=/nologo /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\mod_file_cache.pdb" /debug /out:"$(OUTDIR)\mod_file_cache.so" /implib:"$(OUTDIR)\mod_file_cache.lib" /base:@..\..\os\win32\BaseAddr.ref,mod_file_cache.so
LINK32_OBJS= \
"$(INTDIR)\mod_file_cache.obj" \
"$(INTDIR)\mod_file_cache.res" \
"..\..\srclib\apr\Debug\libapr-1.lib" \
"..\..\srclib\apr-util\Debug\libaprutil-1.lib" \
"..\..\Debug\libhttpd.lib"
"$(OUTDIR)\mod_file_cache.so" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
TargetPath=.\Debug\mod_file_cache.so
SOURCE="$(InputPath)"
PostBuild_Desc=Embed .manifest
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
# Begin Custom Macros
OutDir=.\Debug
# End Custom Macros
"$(DS_POSTBUILD_DEP)" : "$(OUTDIR)\mod_file_cache.so"
if exist .\Debug\mod_file_cache.so.manifest mt.exe -manifest .\Debug\mod_file_cache.so.manifest -outputresource:.\Debug\mod_file_cache.so;2
echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)"
!ENDIF
!IF "$(NO_EXTERNAL_DEPS)" != "1"
!IF EXISTS("mod_file_cache.dep")
!INCLUDE "mod_file_cache.dep"
!ELSE
!MESSAGE Warning: cannot find "mod_file_cache.dep"
!ENDIF
!ENDIF
!IF "$(CFG)" == "mod_file_cache - Win32 Release" || "$(CFG)" == "mod_file_cache - Win32 Debug"
!IF "$(CFG)" == "mod_file_cache - Win32 Release"
"libapr - Win32 Release" :
cd ".\..\..\srclib\apr"
$(MAKE) /$(MAKEFLAGS) /F ".\libapr.mak" CFG="libapr - Win32 Release"
cd "..\..\modules\cache"
"libapr - Win32 ReleaseCLEAN" :
cd ".\..\..\srclib\apr"
$(MAKE) /$(MAKEFLAGS) /F ".\libapr.mak" CFG="libapr - Win32 Release" RECURSE=1 CLEAN
cd "..\..\modules\cache"
!ELSEIF "$(CFG)" == "mod_file_cache - Win32 Debug"
"libapr - Win32 Debug" :
cd ".\..\..\srclib\apr"
$(MAKE) /$(MAKEFLAGS) /F ".\libapr.mak" CFG="libapr - Win32 Debug"
cd "..\..\modules\cache"
"libapr - Win32 DebugCLEAN" :
cd ".\..\..\srclib\apr"
$(MAKE) /$(MAKEFLAGS) /F ".\libapr.mak" CFG="libapr - Win32 Debug" RECURSE=1 CLEAN
cd "..\..\modules\cache"
!ENDIF
!IF "$(CFG)" == "mod_file_cache - Win32 Release"
"libaprutil - Win32 Release" :
cd ".\..\..\srclib\apr-util"
$(MAKE) /$(MAKEFLAGS) /F ".\libaprutil.mak" CFG="libaprutil - Win32 Release"
cd "..\..\modules\cache"
"libaprutil - Win32 ReleaseCLEAN" :
cd ".\..\..\srclib\apr-util"
$(MAKE) /$(MAKEFLAGS) /F ".\libaprutil.mak" CFG="libaprutil - Win32 Release" RECURSE=1 CLEAN
cd "..\..\modules\cache"
!ELSEIF "$(CFG)" == "mod_file_cache - Win32 Debug"
"libaprutil - Win32 Debug" :
cd ".\..\..\srclib\apr-util"
$(MAKE) /$(MAKEFLAGS) /F ".\libaprutil.mak" CFG="libaprutil - Win32 Debug"
cd "..\..\modules\cache"
"libaprutil - Win32 DebugCLEAN" :
cd ".\..\..\srclib\apr-util"
$(MAKE) /$(MAKEFLAGS) /F ".\libaprutil.mak" CFG="libaprutil - Win32 Debug" RECURSE=1 CLEAN
cd "..\..\modules\cache"
!ENDIF
!IF "$(CFG)" == "mod_file_cache - Win32 Release"
"libhttpd - Win32 Release" :
cd ".\..\.."
$(MAKE) /$(MAKEFLAGS) /F ".\libhttpd.mak" CFG="libhttpd - Win32 Release"
cd ".\modules\cache"
"libhttpd - Win32 ReleaseCLEAN" :
cd ".\..\.."
$(MAKE) /$(MAKEFLAGS) /F ".\libhttpd.mak" CFG="libhttpd - Win32 Release" RECURSE=1 CLEAN
cd ".\modules\cache"
!ELSEIF "$(CFG)" == "mod_file_cache - Win32 Debug"
"libhttpd - Win32 Debug" :
cd ".\..\.."
$(MAKE) /$(MAKEFLAGS) /F ".\libhttpd.mak" CFG="libhttpd - Win32 Debug"
cd ".\modules\cache"
"libhttpd - Win32 DebugCLEAN" :
cd ".\..\.."
$(MAKE) /$(MAKEFLAGS) /F ".\libhttpd.mak" CFG="libhttpd - Win32 Debug" RECURSE=1 CLEAN
cd ".\modules\cache"
!ENDIF
SOURCE=..\..\build\win32\httpd.rc
!IF "$(CFG)" == "mod_file_cache - Win32 Release"
"$(INTDIR)\mod_file_cache.res" : $(SOURCE) "$(INTDIR)"
$(RSC) /l 0x409 /fo"$(INTDIR)\mod_file_cache.res" /i "../../include" /i "../../srclib/apr/include" /i "../../build\win32" /d "NDEBUG" /d BIN_NAME="mod_file_cache.so" /d LONG_NAME="file_cache_module for Apache" $(SOURCE)
!ELSEIF "$(CFG)" == "mod_file_cache - Win32 Debug"
"$(INTDIR)\mod_file_cache.res" : $(SOURCE) "$(INTDIR)"
$(RSC) /l 0x409 /fo"$(INTDIR)\mod_file_cache.res" /i "../../include" /i "../../srclib/apr/include" /i "../../build\win32" /d "_DEBUG" /d BIN_NAME="mod_file_cache.so" /d LONG_NAME="file_cache_module for Apache" $(SOURCE)
!ENDIF
SOURCE=.\mod_file_cache.c
"$(INTDIR)\mod_file_cache.obj" : $(SOURCE) "$(INTDIR)"
!ENDIF

764
modules/cache/mod_socache_dbm.c vendored Normal file
View file

@ -0,0 +1,764 @@
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "httpd.h"
#include "http_log.h"
#include "http_request.h"
#include "http_protocol.h"
#include "http_config.h"
#include "mpm_common.h"
#include "mod_status.h"
#include "apr.h"
#include "apr_strings.h"
#include "apr_time.h"
#define APR_WANT_STRFUNC
#include "apr_want.h"
#include "apr_dbm.h"
#if APR_HAVE_UNISTD_H
#include <unistd.h>
#endif
#include "ap_socache.h"
#if AP_NEED_SET_MUTEX_PERMS
#include "unixd.h"
#endif
/* Use of the context structure must be thread-safe after the initial
* create/init; callers must hold the mutex. */
struct ap_socache_instance_t {
const char *data_file;
/* Pool must only be used with the mutex held. */
apr_pool_t *pool;
apr_time_t last_expiry;
apr_interval_time_t expiry_interval;
};
/**
* Support for DBM library
*/
#define DBM_FILE_MODE ( APR_UREAD | APR_UWRITE | APR_GREAD | APR_WREAD )
#define DEFAULT_DBM_PREFIX "socache-dbm-"
/* ### this should use apr_dbm_usednames. */
#if !defined(DBM_FILE_SUFFIX_DIR) && !defined(DBM_FILE_SUFFIX_PAG)
#if defined(DBM_SUFFIX)
#define DBM_FILE_SUFFIX_DIR DBM_SUFFIX
#define DBM_FILE_SUFFIX_PAG DBM_SUFFIX
#elif defined(__FreeBSD__) || (defined(DB_LOCK) && defined(DB_SHMEM))
#define DBM_FILE_SUFFIX_DIR ".db"
#define DBM_FILE_SUFFIX_PAG ".db"
#else
#define DBM_FILE_SUFFIX_DIR ".dir"
#define DBM_FILE_SUFFIX_PAG ".pag"
#endif
#endif
static void socache_dbm_expire(ap_socache_instance_t *ctx, server_rec *s);
static apr_status_t socache_dbm_remove(ap_socache_instance_t *ctx,
server_rec *s, const unsigned char *id,
unsigned int idlen, apr_pool_t *p);
static const char *socache_dbm_create(ap_socache_instance_t **context,
const char *arg,
apr_pool_t *tmp, apr_pool_t *p)
{
ap_socache_instance_t *ctx;
*context = ctx = apr_pcalloc(p, sizeof *ctx);
if (arg && *arg) {
ctx->data_file = ap_server_root_relative(p, arg);
if (!ctx->data_file) {
return apr_psprintf(tmp, "Invalid cache file path %s", arg);
}
}
apr_pool_create(&ctx->pool, p);
apr_pool_tag(ctx->pool, "socache_dbm_instance");
return NULL;
}
#if AP_NEED_SET_MUTEX_PERMS
static int try_chown(apr_pool_t *p, server_rec *s,
const char *name, const char *suffix)
{
if (suffix)
name = apr_pstrcat(p, name, suffix, NULL);
if (-1 == chown(name, ap_unixd_config.user_id,
(gid_t)-1 /* no gid change */ ))
{
if (errno != ENOENT)
ap_log_error(APLOG_MARK, APLOG_ERR, APR_FROM_OS_ERROR(errno), s, APLOGNO(00802)
"Can't change owner of %s", name);
return -1;
}
return 0;
}
#endif
static apr_status_t socache_dbm_init(ap_socache_instance_t *ctx,
const char *namespace,
const struct ap_socache_hints *hints,
server_rec *s, apr_pool_t *p)
{
#if APU_MAJOR_VERSION > 1 || (APU_MAJOR_VERSION == 1 && APU_MINOR_VERSION >= 7)
const apr_dbm_driver_t *driver;
const apu_err_t *err;
#endif
apr_dbm_t *dbm;
apr_status_t rv;
/* for the DBM we need the data file */
if (ctx->data_file == NULL) {
const char *path = apr_pstrcat(p, DEFAULT_DBM_PREFIX, namespace,
NULL);
ctx->data_file = ap_runtime_dir_relative(p, path);
if (ctx->data_file == NULL) {
ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, APLOGNO(00803)
"could not use default path '%s' for DBM socache",
path);
return APR_EINVAL;
}
}
/* open it once to create it and to make sure it _can_ be created */
apr_pool_clear(ctx->pool);
#if APU_MAJOR_VERSION > 1 || (APU_MAJOR_VERSION == 1 && APU_MINOR_VERSION >= 7)
if ((rv = apr_dbm_get_driver(&driver, NULL, &err,
ctx->pool) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(10277)
"Cannot load socache DBM library '%s': %s",
err->reason, err->msg);
return rv;
}
if ((rv = apr_dbm_open2(&dbm, driver, ctx->data_file,
APR_DBM_RWCREATE, DBM_FILE_MODE, ctx->pool)) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(00804)
"Cannot create socache DBM file `%s'",
ctx->data_file);
return DECLINED;
}
#else
if ((rv = apr_dbm_open(&dbm, ctx->data_file,
APR_DBM_RWCREATE, DBM_FILE_MODE, ctx->pool)) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(00804)
"Cannot create socache DBM file `%s'",
ctx->data_file);
return rv;
}
#endif
apr_dbm_close(dbm);
ctx->expiry_interval = (hints && hints->expiry_interval
? hints->expiry_interval : apr_time_from_sec(30));
#if AP_NEED_SET_MUTEX_PERMS
/*
* We have to make sure the Apache child processes have access to
* the DBM file. But because there are brain-dead platforms where we
* cannot exactly determine the suffixes we try all possibilities.
*/
if (geteuid() == 0 /* is superuser */) {
try_chown(p, s, ctx->data_file, NULL);
if (try_chown(p, s, ctx->data_file, DBM_FILE_SUFFIX_DIR))
if (try_chown(p, s, ctx->data_file, ".db"))
try_chown(p, s, ctx->data_file, ".dir");
if (try_chown(p, s, ctx->data_file, DBM_FILE_SUFFIX_PAG))
if (try_chown(p, s, ctx->data_file, ".db"))
try_chown(p, s, ctx->data_file, ".pag");
}
#endif
socache_dbm_expire(ctx, s);
return APR_SUCCESS;
}
static void socache_dbm_destroy(ap_socache_instance_t *ctx, server_rec *s)
{
/* the correct way */
unlink(apr_pstrcat(ctx->pool, ctx->data_file, DBM_FILE_SUFFIX_DIR, NULL));
unlink(apr_pstrcat(ctx->pool, ctx->data_file, DBM_FILE_SUFFIX_PAG, NULL));
/* the additional ways to be sure */
unlink(apr_pstrcat(ctx->pool, ctx->data_file, ".dir", NULL));
unlink(apr_pstrcat(ctx->pool, ctx->data_file, ".pag", NULL));
unlink(apr_pstrcat(ctx->pool, ctx->data_file, ".db", NULL));
unlink(ctx->data_file);
}
static apr_status_t socache_dbm_store(ap_socache_instance_t *ctx,
server_rec *s, const unsigned char *id,
unsigned int idlen, apr_time_t expiry,
unsigned char *ucaData,
unsigned int nData, apr_pool_t *pool)
{
#if APU_MAJOR_VERSION > 1 || (APU_MAJOR_VERSION == 1 && APU_MINOR_VERSION >= 7)
const apr_dbm_driver_t *driver;
const apu_err_t *err;
#endif
apr_dbm_t *dbm;
apr_datum_t dbmkey;
apr_datum_t dbmval;
apr_status_t rv;
/* be careful: do not try to store too much bytes in a DBM file! */
#ifdef PAIRMAX
if ((idlen + nData) >= PAIRMAX) {
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(00805)
"data size too large for DBM socache: %d >= %d",
(idlen + nData), PAIRMAX);
return APR_ENOSPC;
}
#else
if ((idlen + nData) >= 950 /* at least less than approx. 1KB */) {
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(00806)
"data size too large for DBM socache: %d >= %d",
(idlen + nData), 950);
return APR_ENOSPC;
}
#endif
/* create DBM key */
dbmkey.dptr = (char *)id;
dbmkey.dsize = idlen;
/* create DBM value */
dbmval.dsize = sizeof(apr_time_t) + nData;
dbmval.dptr = (char *)ap_malloc(dbmval.dsize);
memcpy((char *)dbmval.dptr, &expiry, sizeof(apr_time_t));
memcpy((char *)dbmval.dptr+sizeof(apr_time_t), ucaData, nData);
/* and store it to the DBM file */
apr_pool_clear(ctx->pool);
#if APU_MAJOR_VERSION > 1 || (APU_MAJOR_VERSION == 1 && APU_MINOR_VERSION >= 7)
if ((rv = apr_dbm_get_driver(&driver, NULL, &err,
ctx->pool) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(10278)
"Cannot load socache DBM library '%s' (store): %s",
err->reason, err->msg);
free(dbmval.dptr);
return rv;
}
if ((rv = apr_dbm_open2(&dbm, driver, ctx->data_file,
APR_DBM_RWCREATE, DBM_FILE_MODE, ctx->pool)) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(00807)
"Cannot open socache DBM file `%s' for writing "
"(store)",
ctx->data_file);
free(dbmval.dptr);
return rv;
}
#else
if ((rv = apr_dbm_open(&dbm, ctx->data_file,
APR_DBM_RWCREATE, DBM_FILE_MODE, ctx->pool)) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(00807)
"Cannot open socache DBM file `%s' for writing "
"(store)",
ctx->data_file);
free(dbmval.dptr);
return rv;
}
#endif
if ((rv = apr_dbm_store(dbm, dbmkey, dbmval)) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(00808)
"Cannot store socache object to DBM file `%s'",
ctx->data_file);
apr_dbm_close(dbm);
free(dbmval.dptr);
return rv;
}
apr_dbm_close(dbm);
/* free temporary buffers */
free(dbmval.dptr);
/* allow the regular expiring to occur */
socache_dbm_expire(ctx, s);
return APR_SUCCESS;
}
static apr_status_t socache_dbm_retrieve(ap_socache_instance_t *ctx, server_rec *s,
const unsigned char *id, unsigned int idlen,
unsigned char *dest, unsigned int *destlen,
apr_pool_t *p)
{
#if APU_MAJOR_VERSION > 1 || (APU_MAJOR_VERSION == 1 && APU_MINOR_VERSION >= 7)
const apr_dbm_driver_t *driver;
const apu_err_t *err;
#endif
apr_dbm_t *dbm;
apr_datum_t dbmkey;
apr_datum_t dbmval;
unsigned int nData;
apr_time_t expiry;
apr_time_t now;
apr_status_t rc;
/* allow the regular expiring to occur */
socache_dbm_expire(ctx, s);
/* create DBM key and values */
dbmkey.dptr = (char *)id;
dbmkey.dsize = idlen;
/* and fetch it from the DBM file
* XXX: Should we open the dbm against r->pool so the cleanup will
* do the apr_dbm_close? This would make the code a bit cleaner.
*/
apr_pool_clear(ctx->pool);
#if APU_MAJOR_VERSION > 1 || (APU_MAJOR_VERSION == 1 && APU_MINOR_VERSION >= 7)
if ((rv = apr_dbm_get_driver(&driver, NULL, &err,
ctx->pool) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(10279)
"Cannot load socache DBM library '%s' (fetch): %s",
err->reason, err->msg);
return rc;
}
if ((rv = apr_dbm_open2(&dbm, driver, ctx->data_file,
APR_DBM_RWCREATE, DBM_FILE_MODE, ctx->pool)) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rc, s, APLOGNO(00809)
"Cannot open socache DBM file `%s' for reading "
"(fetch)",
ctx->data_file);
return rc;
}
#else
if ((rc = apr_dbm_open(&dbm, ctx->data_file, APR_DBM_RWCREATE,
DBM_FILE_MODE, ctx->pool)) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rc, s, APLOGNO(00809)
"Cannot open socache DBM file `%s' for reading "
"(fetch)",
ctx->data_file);
return rc;
}
#endif
rc = apr_dbm_fetch(dbm, dbmkey, &dbmval);
if (rc != APR_SUCCESS) {
apr_dbm_close(dbm);
return APR_NOTFOUND;
}
if (dbmval.dptr == NULL || dbmval.dsize <= sizeof(apr_time_t)) {
apr_dbm_close(dbm);
return APR_EGENERAL;
}
/* parse resulting data */
nData = dbmval.dsize-sizeof(apr_time_t);
if (nData > *destlen) {
apr_dbm_close(dbm);
return APR_ENOSPC;
}
*destlen = nData;
memcpy(&expiry, dbmval.dptr, sizeof(apr_time_t));
memcpy(dest, (char *)dbmval.dptr + sizeof(apr_time_t), nData);
apr_dbm_close(dbm);
/* make sure the stuff is still not expired */
now = apr_time_now();
if (expiry <= now) {
socache_dbm_remove(ctx, s, id, idlen, p);
return APR_NOTFOUND;
}
return APR_SUCCESS;
}
static apr_status_t socache_dbm_remove(ap_socache_instance_t *ctx,
server_rec *s, const unsigned char *id,
unsigned int idlen, apr_pool_t *p)
{
#if APU_MAJOR_VERSION > 1 || (APU_MAJOR_VERSION == 1 && APU_MINOR_VERSION >= 7)
const apr_dbm_driver_t *driver;
const apu_err_t *err;
#endif
apr_dbm_t *dbm;
apr_datum_t dbmkey;
apr_status_t rv;
/* create DBM key and values */
dbmkey.dptr = (char *)id;
dbmkey.dsize = idlen;
/* and delete it from the DBM file */
apr_pool_clear(ctx->pool);
#if APU_MAJOR_VERSION > 1 || (APU_MAJOR_VERSION == 1 && APU_MINOR_VERSION >= 7)
if ((rv = apr_dbm_get_driver(&driver, NULL, &err,
ctx->pool) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(10280)
"Cannot load socache DBM library '%s' (delete): %s",
err->reason, err->msg);
return rv;
}
if ((rv = apr_dbm_open2(&dbm, driver, ctx->data_file,
APR_DBM_RWCREATE, DBM_FILE_MODE, ctx->pool)) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(00810)
"Cannot open socache DBM file `%s' for writing "
"(delete)",
ctx->data_file);
return rv;
}
#else
if ((rv = apr_dbm_open(&dbm, ctx->data_file, APR_DBM_RWCREATE,
DBM_FILE_MODE, ctx->pool)) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(00810)
"Cannot open socache DBM file `%s' for writing "
"(delete)",
ctx->data_file);
return rv;
}
#endif
apr_dbm_delete(dbm, dbmkey);
apr_dbm_close(dbm);
return APR_SUCCESS;
}
static void socache_dbm_expire(ap_socache_instance_t *ctx, server_rec *s)
{
#if APU_MAJOR_VERSION > 1 || (APU_MAJOR_VERSION == 1 && APU_MINOR_VERSION >= 7)
const apr_dbm_driver_t *driver;
const apu_err_t *err;
#endif
apr_dbm_t *dbm;
apr_datum_t dbmkey;
apr_datum_t dbmval;
apr_time_t expiry;
int elts = 0;
int deleted = 0;
int expired;
apr_datum_t *keylist;
int keyidx;
int i;
apr_time_t now;
apr_status_t rv;
/*
* make sure the expiration for still not-accessed
* socache entries is done only from time to time
*/
now = apr_time_now();
if (now < ctx->last_expiry + ctx->expiry_interval) {
return;
}
ctx->last_expiry = now;
#if APU_MAJOR_VERSION > 1 || (APU_MAJOR_VERSION == 1 && APU_MINOR_VERSION >= 7)
if ((rv = apr_dbm_get_driver(&driver, NULL, &err,
ctx->pool) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(10281)
"Cannot load socache DBM library '%s' (expire): %s",
err->reason, err->msg);
return rv;
}
#endif
/*
* Here we have to be very carefully: Not all DBM libraries are
* smart enough to allow one to iterate over the elements and at the
* same time delete expired ones. Some of them get totally crazy
* while others have no problems. So we have to do it the slower but
* more safe way: we first iterate over all elements and remember
* those which have to be expired. Then in a second pass we delete
* all those expired elements. Additionally we reopen the DBM file
* to be really safe in state.
*/
#define KEYMAX 1024
for (;;) {
/* allocate the key array in a memory sub pool */
apr_pool_clear(ctx->pool);
if ((keylist = apr_palloc(ctx->pool, sizeof(dbmkey)*KEYMAX)) == NULL) {
break;
}
/* pass 1: scan DBM database */
keyidx = 0;
#if APU_MAJOR_VERSION > 1 || (APU_MAJOR_VERSION == 1 && APU_MINOR_VERSION >= 7)
if ((rv = apr_dbm_open2(&dbm, driver, ctx->data_file, APR_DBM_RWCREATE,
DBM_FILE_MODE, ctx->pool)) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(00811)
"Cannot open socache DBM file `%s' for "
"scanning",
ctx->data_file);
break;
}
#else
if ((rv = apr_dbm_open(&dbm, ctx->data_file, APR_DBM_RWCREATE,
DBM_FILE_MODE, ctx->pool)) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(00811)
"Cannot open socache DBM file `%s' for "
"scanning",
ctx->data_file);
break;
}
#endif
apr_dbm_firstkey(dbm, &dbmkey);
while (dbmkey.dptr != NULL) {
elts++;
expired = FALSE;
apr_dbm_fetch(dbm, dbmkey, &dbmval);
if (dbmval.dsize <= sizeof(apr_time_t) || dbmval.dptr == NULL)
expired = TRUE;
else {
memcpy(&expiry, dbmval.dptr, sizeof(apr_time_t));
if (expiry <= now)
expired = TRUE;
}
if (expired) {
if ((keylist[keyidx].dptr = apr_pmemdup(ctx->pool, dbmkey.dptr, dbmkey.dsize)) != NULL) {
keylist[keyidx].dsize = dbmkey.dsize;
keyidx++;
if (keyidx == KEYMAX)
break;
}
}
apr_dbm_nextkey(dbm, &dbmkey);
}
apr_dbm_close(dbm);
/* pass 2: delete expired elements */
#if APU_MAJOR_VERSION > 1 || (APU_MAJOR_VERSION == 1 && APU_MINOR_VERSION >= 7)
if (apr_dbm_open2(&dbm, driver, ctx->data_file, APR_DBM_RWCREATE,
DBM_FILE_MODE, ctx->pool) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(00812)
"Cannot re-open socache DBM file `%s' for "
"expiring",
ctx->data_file);
break;
}
#else
if (apr_dbm_open(&dbm, ctx->data_file, APR_DBM_RWCREATE,
DBM_FILE_MODE, ctx->pool) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(00812)
"Cannot re-open socache DBM file `%s' for "
"expiring",
ctx->data_file);
break;
}
#endif
for (i = 0; i < keyidx; i++) {
apr_dbm_delete(dbm, keylist[i]);
deleted++;
}
apr_dbm_close(dbm);
if (keyidx < KEYMAX)
break;
}
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(00813)
"DBM socache expiry: "
"old: %d, new: %d, removed: %d",
elts, elts-deleted, deleted);
}
static void socache_dbm_status(ap_socache_instance_t *ctx, request_rec *r,
int flags)
{
#if APU_MAJOR_VERSION > 1 || (APU_MAJOR_VERSION == 1 && APU_MINOR_VERSION >= 7)
const apr_dbm_driver_t *driver;
const apu_err_t *err;
#endif
apr_dbm_t *dbm;
apr_datum_t dbmkey;
apr_datum_t dbmval;
int elts;
long size;
int avg;
apr_status_t rv;
elts = 0;
size = 0;
apr_pool_clear(ctx->pool);
#if APU_MAJOR_VERSION > 1 || (APU_MAJOR_VERSION == 1 && APU_MINOR_VERSION >= 7)
if ((rv = apr_dbm_get_driver(&driver, NULL, &err,
ctx->pool) != APR_SUCCESS) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(10282)
"Cannot load socache DBM library '%s' (status retrieval): %s",
err->reason, err->msg);
return;
}
if ((rv = apr_dbm_open2(&dbm, driver, ctx->data_file, APR_DBM_RWCREATE,
DBM_FILE_MODE, ctx->pool)) != APR_SUCCESS) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(00814)
"Cannot open socache DBM file `%s' for status "
"retrieval",
ctx->data_file);
return;
}
#else
if ((rv = apr_dbm_open(&dbm, ctx->data_file, APR_DBM_RWCREATE,
DBM_FILE_MODE, ctx->pool)) != APR_SUCCESS) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(00814)
"Cannot open socache DBM file `%s' for status "
"retrieval",
ctx->data_file);
return;
}
#endif
/*
* XXX - Check the return value of apr_dbm_firstkey, apr_dbm_fetch - TBD
*/
apr_dbm_firstkey(dbm, &dbmkey);
for ( ; dbmkey.dptr != NULL; apr_dbm_nextkey(dbm, &dbmkey)) {
apr_dbm_fetch(dbm, dbmkey, &dbmval);
if (dbmval.dptr == NULL)
continue;
elts += 1;
size += dbmval.dsize;
}
apr_dbm_close(dbm);
if (size > 0 && elts > 0)
avg = (int)(size / (long)elts);
else
avg = 0;
if (!(flags & AP_STATUS_SHORT)) {
ap_rprintf(r, "cache type: <b>DBM</b>, maximum size: <b>unlimited</b><br>");
ap_rprintf(r, "current entries: <b>%d</b>, current size: <b>%ld</b> bytes<br>", elts, size);
ap_rprintf(r, "average entry size: <b>%d</b> bytes<br>", avg);
}
else {
ap_rputs("CacheType: DBM\n", r);
ap_rputs("CacheMaximumSize: unlimited\n", r);
ap_rprintf(r, "CacheCurrentEntries: %d\n", elts);
ap_rprintf(r, "CacheCurrentSize: %ld\n", size);
ap_rprintf(r, "CacheAvgEntrySize: %d\n", avg);
}
}
static apr_status_t socache_dbm_iterate(ap_socache_instance_t *ctx,
server_rec *s, void *userctx,
ap_socache_iterator_t *iterator,
apr_pool_t *pool)
{
#if APU_MAJOR_VERSION > 1 || (APU_MAJOR_VERSION == 1 && APU_MINOR_VERSION >= 7)
const apr_dbm_driver_t *driver;
const apu_err_t *err;
#endif
apr_dbm_t *dbm;
apr_datum_t dbmkey;
apr_datum_t dbmval;
apr_time_t expiry;
int expired;
apr_time_t now;
apr_status_t rv;
/*
* make sure the expired records are omitted
*/
now = apr_time_now();
#if APU_MAJOR_VERSION > 1 || (APU_MAJOR_VERSION == 1 && APU_MINOR_VERSION >= 7)
if ((rv = apr_dbm_get_driver(&driver, NULL, &err,
ctx->pool) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(10283)
"Cannot load socache DBM library '%s' (iterating): %s",
err->reason, err->msg);
return rv;
}
if ((rv = apr_dbm_open2(&dbm, driver, ctx->data_file, APR_DBM_RWCREATE,
DBM_FILE_MODE, ctx->pool)) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(00815)
"Cannot open socache DBM file `%s' for "
"iterating", ctx->data_file);
return rv;
}
#else
if ((rv = apr_dbm_open(&dbm, ctx->data_file, APR_DBM_RWCREATE,
DBM_FILE_MODE, ctx->pool)) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(00815)
"Cannot open socache DBM file `%s' for "
"iterating", ctx->data_file);
return rv;
}
#endif
rv = apr_dbm_firstkey(dbm, &dbmkey);
while (rv == APR_SUCCESS && dbmkey.dptr != NULL) {
expired = FALSE;
apr_dbm_fetch(dbm, dbmkey, &dbmval);
if (dbmval.dsize <= sizeof(apr_time_t) || dbmval.dptr == NULL)
expired = TRUE;
else {
memcpy(&expiry, dbmval.dptr, sizeof(apr_time_t));
if (expiry <= now)
expired = TRUE;
}
if (!expired) {
rv = iterator(ctx, s, userctx,
(unsigned char *)dbmkey.dptr, dbmkey.dsize,
(unsigned char *)dbmval.dptr + sizeof(apr_time_t),
dbmval.dsize - sizeof(apr_time_t), pool);
ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, s, APLOGNO(00816)
"dbm `%s' entry iterated", ctx->data_file);
if (rv != APR_SUCCESS)
return rv;
}
rv = apr_dbm_nextkey(dbm, &dbmkey);
}
apr_dbm_close(dbm);
if (rv != APR_SUCCESS && rv != APR_EOF) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(00817)
"Failure reading first/next socache DBM file `%s' record",
ctx->data_file);
return rv;
}
return APR_SUCCESS;
}
static const ap_socache_provider_t socache_dbm = {
"dbm",
AP_SOCACHE_FLAG_NOTMPSAFE,
socache_dbm_create,
socache_dbm_init,
socache_dbm_destroy,
socache_dbm_store,
socache_dbm_retrieve,
socache_dbm_remove,
socache_dbm_status,
socache_dbm_iterate
};
static void register_hooks(apr_pool_t *p)
{
ap_register_provider(p, AP_SOCACHE_PROVIDER_GROUP, "dbm",
AP_SOCACHE_PROVIDER_VERSION,
&socache_dbm);
}
AP_DECLARE_MODULE(socache_dbm) = {
STANDARD20_MODULE_STUFF,
NULL, NULL, NULL, NULL, NULL,
register_hooks
};

60
modules/cache/mod_socache_dbm.dep vendored Normal file
View file

@ -0,0 +1,60 @@
# Microsoft Developer Studio Generated Dependency File, included by mod_socache_dbm.mak
..\..\build\win32\httpd.rc : \
"..\..\include\ap_release.h"\
.\mod_socache_dbm.c : \
"..\..\include\ap_config.h"\
"..\..\include\ap_config_layout.h"\
"..\..\include\ap_hooks.h"\
"..\..\include\ap_mmn.h"\
"..\..\include\ap_mpm.h"\
"..\..\include\ap_provider.h"\
"..\..\include\ap_regex.h"\
"..\..\include\ap_release.h"\
"..\..\include\ap_socache.h"\
"..\..\include\apache_noprobes.h"\
"..\..\include\http_config.h"\
"..\..\include\http_log.h"\
"..\..\include\http_protocol.h"\
"..\..\include\http_request.h"\
"..\..\include\httpd.h"\
"..\..\include\mpm_common.h"\
"..\..\include\os.h"\
"..\..\include\scoreboard.h"\
"..\..\include\util_cfgtree.h"\
"..\..\include\util_filter.h"\
"..\..\srclib\apr-util\include\apr_buckets.h"\
"..\..\srclib\apr-util\include\apr_dbm.h"\
"..\..\srclib\apr-util\include\apr_hooks.h"\
"..\..\srclib\apr-util\include\apr_optional.h"\
"..\..\srclib\apr-util\include\apr_optional_hooks.h"\
"..\..\srclib\apr-util\include\apr_uri.h"\
"..\..\srclib\apr-util\include\apu.h"\
"..\..\srclib\apr\include\apr.h"\
"..\..\srclib\apr\include\apr_allocator.h"\
"..\..\srclib\apr\include\apr_dso.h"\
"..\..\srclib\apr\include\apr_errno.h"\
"..\..\srclib\apr\include\apr_file_info.h"\
"..\..\srclib\apr\include\apr_file_io.h"\
"..\..\srclib\apr\include\apr_general.h"\
"..\..\srclib\apr\include\apr_global_mutex.h"\
"..\..\srclib\apr\include\apr_inherit.h"\
"..\..\srclib\apr\include\apr_mmap.h"\
"..\..\srclib\apr\include\apr_network_io.h"\
"..\..\srclib\apr\include\apr_poll.h"\
"..\..\srclib\apr\include\apr_pools.h"\
"..\..\srclib\apr\include\apr_portable.h"\
"..\..\srclib\apr\include\apr_proc_mutex.h"\
"..\..\srclib\apr\include\apr_ring.h"\
"..\..\srclib\apr\include\apr_shm.h"\
"..\..\srclib\apr\include\apr_strings.h"\
"..\..\srclib\apr\include\apr_tables.h"\
"..\..\srclib\apr\include\apr_thread_mutex.h"\
"..\..\srclib\apr\include\apr_thread_proc.h"\
"..\..\srclib\apr\include\apr_time.h"\
"..\..\srclib\apr\include\apr_user.h"\
"..\..\srclib\apr\include\apr_want.h"\
"..\generators\mod_status.h"\

111
modules/cache/mod_socache_dbm.dsp vendored Normal file
View file

@ -0,0 +1,111 @@
# Microsoft Developer Studio Project File - Name="mod_socache_dbm" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=mod_socache_dbm - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "mod_socache_dbm.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "mod_socache_dbm.mak" CFG="mod_socache_dbm - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "mod_socache_dbm - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "mod_socache_dbm - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "mod_socache_dbm - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "mod_socache_dbm_EXPORTS" /FD /c
# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../../srclib/apr-util/include" /I "../../srclib/apr/include" /I "../../include" /I "../generators" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Release\mod_socache_dbm_src" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /fo"Release/mod_socache_dbm.res" /i "../../include" /i "../../srclib/apr/include" /d "NDEBUG" /d BIN_NAME="mod_socache_dbm.so" /d LONG_NAME="socache_dbm_module for Apache"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll
# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_socache_dbm.so" /base:@..\..\os\win32\BaseAddr.ref,mod_socache_dbm.so /opt:ref
# Begin Special Build Tool
TargetPath=.\Release\mod_socache_dbm.so
SOURCE="$(InputPath)"
PostBuild_Desc=Embed .manifest
PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2
# End Special Build Tool
!ELSEIF "$(CFG)" == "mod_socache_dbm - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c
# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../../srclib/apr-util/include" /I "../../srclib/apr/include" /I "../../include" /I "../generators" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Debug\mod_socache_dbm_src" /FD /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /fo"Debug/mod_socache_dbm.res" /i "../../include" /i "../../srclib/apr/include" /d "_DEBUG" /d BIN_NAME="mod_socache_dbm.so" /d LONG_NAME="socache_dbm_module for Apache"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug
# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_socache_dbm.so" /base:@..\..\os\win32\BaseAddr.ref,mod_socache_dbm.so
# Begin Special Build Tool
TargetPath=.\Debug\mod_socache_dbm.so
SOURCE="$(InputPath)"
PostBuild_Desc=Embed .manifest
PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2
# End Special Build Tool
!ENDIF
# Begin Target
# Name "mod_socache_dbm - Win32 Release"
# Name "mod_socache_dbm - Win32 Debug"
# Begin Source File
SOURCE=.\mod_socache_dbm.c
# End Source File
# Begin Source File
SOURCE=..\..\build\win32\httpd.rc
# End Source File
# End Target
# End Project

353
modules/cache/mod_socache_dbm.mak vendored Normal file
View file

@ -0,0 +1,353 @@
# Microsoft Developer Studio Generated NMAKE File, Based on mod_socache_dbm.dsp
!IF "$(CFG)" == ""
CFG=mod_socache_dbm - Win32 Debug
!MESSAGE No configuration specified. Defaulting to mod_socache_dbm - Win32 Debug.
!ENDIF
!IF "$(CFG)" != "mod_socache_dbm - Win32 Release" && "$(CFG)" != "mod_socache_dbm - Win32 Debug"
!MESSAGE Invalid configuration "$(CFG)" specified.
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "mod_socache_dbm.mak" CFG="mod_socache_dbm - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "mod_socache_dbm - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "mod_socache_dbm - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
!ERROR An invalid configuration is specified.
!ENDIF
!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF
!IF "$(CFG)" == "mod_socache_dbm - Win32 Release"
OUTDIR=.\Release
INTDIR=.\Release
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
# Begin Custom Macros
OutDir=.\Release
# End Custom Macros
!IF "$(RECURSE)" == "0"
ALL : "$(OUTDIR)\mod_socache_dbm.so" "$(DS_POSTBUILD_DEP)"
!ELSE
ALL : "libhttpd - Win32 Release" "libaprutil - Win32 Release" "libapr - Win32 Release" "$(OUTDIR)\mod_socache_dbm.so" "$(DS_POSTBUILD_DEP)"
!ENDIF
!IF "$(RECURSE)" == "1"
CLEAN :"libapr - Win32 ReleaseCLEAN" "libaprutil - Win32 ReleaseCLEAN" "libhttpd - Win32 ReleaseCLEAN"
!ELSE
CLEAN :
!ENDIF
-@erase "$(INTDIR)\mod_socache_dbm.obj"
-@erase "$(INTDIR)\mod_socache_dbm.res"
-@erase "$(INTDIR)\mod_socache_dbm_src.idb"
-@erase "$(INTDIR)\mod_socache_dbm_src.pdb"
-@erase "$(OUTDIR)\mod_socache_dbm.exp"
-@erase "$(OUTDIR)\mod_socache_dbm.lib"
-@erase "$(OUTDIR)\mod_socache_dbm.pdb"
-@erase "$(OUTDIR)\mod_socache_dbm.so"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP=cl.exe
CPP_PROJ=/nologo /MD /W3 /Zi /O2 /Oy- /I "../../srclib/apr-util/include" /I "../../srclib/apr/include" /I "../../include" /I "../generators" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\mod_socache_dbm_src" /FD /c
.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
MTL=midl.exe
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
RSC=rc.exe
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\mod_socache_dbm.res" /i "../../include" /i "../../srclib/apr/include" /d "NDEBUG" /d BIN_NAME="mod_socache_dbm.so" /d LONG_NAME="socache_dbm_module for Apache"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\mod_socache_dbm.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=kernel32.lib /nologo /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\mod_socache_dbm.pdb" /debug /out:"$(OUTDIR)\mod_socache_dbm.so" /implib:"$(OUTDIR)\mod_socache_dbm.lib" /base:@..\..\os\win32\BaseAddr.ref,mod_socache_dbm.so /opt:ref
LINK32_OBJS= \
"$(INTDIR)\mod_socache_dbm.obj" \
"$(INTDIR)\mod_socache_dbm.res" \
"..\..\srclib\apr\Release\libapr-1.lib" \
"..\..\srclib\apr-util\Release\libaprutil-1.lib" \
"..\..\Release\libhttpd.lib"
"$(OUTDIR)\mod_socache_dbm.so" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
TargetPath=.\Release\mod_socache_dbm.so
SOURCE="$(InputPath)"
PostBuild_Desc=Embed .manifest
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
# Begin Custom Macros
OutDir=.\Release
# End Custom Macros
"$(DS_POSTBUILD_DEP)" : "$(OUTDIR)\mod_socache_dbm.so"
if exist .\Release\mod_socache_dbm.so.manifest mt.exe -manifest .\Release\mod_socache_dbm.so.manifest -outputresource:.\Release\mod_socache_dbm.so;2
echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)"
!ELSEIF "$(CFG)" == "mod_socache_dbm - Win32 Debug"
OUTDIR=.\Debug
INTDIR=.\Debug
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
# Begin Custom Macros
OutDir=.\Debug
# End Custom Macros
!IF "$(RECURSE)" == "0"
ALL : "$(OUTDIR)\mod_socache_dbm.so" "$(DS_POSTBUILD_DEP)"
!ELSE
ALL : "libhttpd - Win32 Debug" "libaprutil - Win32 Debug" "libapr - Win32 Debug" "$(OUTDIR)\mod_socache_dbm.so" "$(DS_POSTBUILD_DEP)"
!ENDIF
!IF "$(RECURSE)" == "1"
CLEAN :"libapr - Win32 DebugCLEAN" "libaprutil - Win32 DebugCLEAN" "libhttpd - Win32 DebugCLEAN"
!ELSE
CLEAN :
!ENDIF
-@erase "$(INTDIR)\mod_socache_dbm.obj"
-@erase "$(INTDIR)\mod_socache_dbm.res"
-@erase "$(INTDIR)\mod_socache_dbm_src.idb"
-@erase "$(INTDIR)\mod_socache_dbm_src.pdb"
-@erase "$(OUTDIR)\mod_socache_dbm.exp"
-@erase "$(OUTDIR)\mod_socache_dbm.lib"
-@erase "$(OUTDIR)\mod_socache_dbm.pdb"
-@erase "$(OUTDIR)\mod_socache_dbm.so"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP=cl.exe
CPP_PROJ=/nologo /MDd /W3 /Zi /Od /I "../../srclib/apr-util/include" /I "../../srclib/apr/include" /I "../../include" /I "../generators" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\mod_socache_dbm_src" /FD /EHsc /c
.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
MTL=midl.exe
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
RSC=rc.exe
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\mod_socache_dbm.res" /i "../../include" /i "../../srclib/apr/include" /d "_DEBUG" /d BIN_NAME="mod_socache_dbm.so" /d LONG_NAME="socache_dbm_module for Apache"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\mod_socache_dbm.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=kernel32.lib /nologo /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\mod_socache_dbm.pdb" /debug /out:"$(OUTDIR)\mod_socache_dbm.so" /implib:"$(OUTDIR)\mod_socache_dbm.lib" /base:@..\..\os\win32\BaseAddr.ref,mod_socache_dbm.so
LINK32_OBJS= \
"$(INTDIR)\mod_socache_dbm.obj" \
"$(INTDIR)\mod_socache_dbm.res" \
"..\..\srclib\apr\Debug\libapr-1.lib" \
"..\..\srclib\apr-util\Debug\libaprutil-1.lib" \
"..\..\Debug\libhttpd.lib"
"$(OUTDIR)\mod_socache_dbm.so" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
TargetPath=.\Debug\mod_socache_dbm.so
SOURCE="$(InputPath)"
PostBuild_Desc=Embed .manifest
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
# Begin Custom Macros
OutDir=.\Debug
# End Custom Macros
"$(DS_POSTBUILD_DEP)" : "$(OUTDIR)\mod_socache_dbm.so"
if exist .\Debug\mod_socache_dbm.so.manifest mt.exe -manifest .\Debug\mod_socache_dbm.so.manifest -outputresource:.\Debug\mod_socache_dbm.so;2
echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)"
!ENDIF
!IF "$(NO_EXTERNAL_DEPS)" != "1"
!IF EXISTS("mod_socache_dbm.dep")
!INCLUDE "mod_socache_dbm.dep"
!ELSE
!MESSAGE Warning: cannot find "mod_socache_dbm.dep"
!ENDIF
!ENDIF
!IF "$(CFG)" == "mod_socache_dbm - Win32 Release" || "$(CFG)" == "mod_socache_dbm - Win32 Debug"
!IF "$(CFG)" == "mod_socache_dbm - Win32 Release"
"libapr - Win32 Release" :
cd ".\..\..\srclib\apr"
$(MAKE) /$(MAKEFLAGS) /F ".\libapr.mak" CFG="libapr - Win32 Release"
cd "..\..\modules\cache"
"libapr - Win32 ReleaseCLEAN" :
cd ".\..\..\srclib\apr"
$(MAKE) /$(MAKEFLAGS) /F ".\libapr.mak" CFG="libapr - Win32 Release" RECURSE=1 CLEAN
cd "..\..\modules\cache"
!ELSEIF "$(CFG)" == "mod_socache_dbm - Win32 Debug"
"libapr - Win32 Debug" :
cd ".\..\..\srclib\apr"
$(MAKE) /$(MAKEFLAGS) /F ".\libapr.mak" CFG="libapr - Win32 Debug"
cd "..\..\modules\cache"
"libapr - Win32 DebugCLEAN" :
cd ".\..\..\srclib\apr"
$(MAKE) /$(MAKEFLAGS) /F ".\libapr.mak" CFG="libapr - Win32 Debug" RECURSE=1 CLEAN
cd "..\..\modules\cache"
!ENDIF
!IF "$(CFG)" == "mod_socache_dbm - Win32 Release"
"libaprutil - Win32 Release" :
cd ".\..\..\srclib\apr-util"
$(MAKE) /$(MAKEFLAGS) /F ".\libaprutil.mak" CFG="libaprutil - Win32 Release"
cd "..\..\modules\cache"
"libaprutil - Win32 ReleaseCLEAN" :
cd ".\..\..\srclib\apr-util"
$(MAKE) /$(MAKEFLAGS) /F ".\libaprutil.mak" CFG="libaprutil - Win32 Release" RECURSE=1 CLEAN
cd "..\..\modules\cache"
!ELSEIF "$(CFG)" == "mod_socache_dbm - Win32 Debug"
"libaprutil - Win32 Debug" :
cd ".\..\..\srclib\apr-util"
$(MAKE) /$(MAKEFLAGS) /F ".\libaprutil.mak" CFG="libaprutil - Win32 Debug"
cd "..\..\modules\cache"
"libaprutil - Win32 DebugCLEAN" :
cd ".\..\..\srclib\apr-util"
$(MAKE) /$(MAKEFLAGS) /F ".\libaprutil.mak" CFG="libaprutil - Win32 Debug" RECURSE=1 CLEAN
cd "..\..\modules\cache"
!ENDIF
!IF "$(CFG)" == "mod_socache_dbm - Win32 Release"
"libhttpd - Win32 Release" :
cd ".\..\.."
$(MAKE) /$(MAKEFLAGS) /F ".\libhttpd.mak" CFG="libhttpd - Win32 Release"
cd ".\modules\cache"
"libhttpd - Win32 ReleaseCLEAN" :
cd ".\..\.."
$(MAKE) /$(MAKEFLAGS) /F ".\libhttpd.mak" CFG="libhttpd - Win32 Release" RECURSE=1 CLEAN
cd ".\modules\cache"
!ELSEIF "$(CFG)" == "mod_socache_dbm - Win32 Debug"
"libhttpd - Win32 Debug" :
cd ".\..\.."
$(MAKE) /$(MAKEFLAGS) /F ".\libhttpd.mak" CFG="libhttpd - Win32 Debug"
cd ".\modules\cache"
"libhttpd - Win32 DebugCLEAN" :
cd ".\..\.."
$(MAKE) /$(MAKEFLAGS) /F ".\libhttpd.mak" CFG="libhttpd - Win32 Debug" RECURSE=1 CLEAN
cd ".\modules\cache"
!ENDIF
SOURCE=..\..\build\win32\httpd.rc
!IF "$(CFG)" == "mod_socache_dbm - Win32 Release"
"$(INTDIR)\mod_socache_dbm.res" : $(SOURCE) "$(INTDIR)"
$(RSC) /l 0x409 /fo"$(INTDIR)\mod_socache_dbm.res" /i "../../include" /i "../../srclib/apr/include" /i "../../build\win32" /d "NDEBUG" /d BIN_NAME="mod_socache_dbm.so" /d LONG_NAME="socache_dbm_module for Apache" $(SOURCE)
!ELSEIF "$(CFG)" == "mod_socache_dbm - Win32 Debug"
"$(INTDIR)\mod_socache_dbm.res" : $(SOURCE) "$(INTDIR)"
$(RSC) /l 0x409 /fo"$(INTDIR)\mod_socache_dbm.res" /i "../../include" /i "../../srclib/apr/include" /i "../../build\win32" /d "_DEBUG" /d BIN_NAME="mod_socache_dbm.so" /d LONG_NAME="socache_dbm_module for Apache" $(SOURCE)
!ENDIF
SOURCE=.\mod_socache_dbm.c
"$(INTDIR)\mod_socache_dbm.obj" : $(SOURCE) "$(INTDIR)"
!ENDIF

198
modules/cache/mod_socache_dc.c vendored Normal file
View file

@ -0,0 +1,198 @@
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "httpd.h"
#include "http_log.h"
#include "http_request.h"
#include "http_config.h"
#include "http_protocol.h"
#include "mod_status.h"
#include "apr_strings.h"
#include "apr_time.h"
#include "ap_socache.h"
#include "distcache/dc_client.h"
#if !defined(DISTCACHE_CLIENT_API) || (DISTCACHE_CLIENT_API < 0x0001)
#error "You must compile with a more recent version of the distcache-base package"
#endif
struct ap_socache_instance_t {
/* Configured target server: */
const char *target;
/* distcache client context: */
DC_CTX *dc;
};
static const char *socache_dc_create(ap_socache_instance_t **context,
const char *arg,
apr_pool_t *tmp, apr_pool_t *p)
{
struct ap_socache_instance_t *ctx;
ctx = *context = apr_palloc(p, sizeof *ctx);
ctx->target = apr_pstrdup(p, arg);
return NULL;
}
static apr_status_t socache_dc_init(ap_socache_instance_t *ctx,
const char *namespace,
const struct ap_socache_hints *hints,
server_rec *s, apr_pool_t *p)
{
#if 0
/* If a "persistent connection" mode of operation is preferred, you *must*
* also use the PIDCHECK flag to ensure fork()'d processes don't interlace
* comms on the same connection as each other. */
#define SESSION_CTX_FLAGS SESSION_CTX_FLAG_PERSISTENT | \
SESSION_CTX_FLAG_PERSISTENT_PIDCHECK | \
SESSION_CTX_FLAG_PERSISTENT_RETRY | \
SESSION_CTX_FLAG_PERSISTENT_LATE
#else
/* This mode of operation will open a temporary connection to the 'target'
* for each cache operation - this makes it safe against fork()
* automatically. This mode is preferred when running a local proxy (over
* unix domain sockets) because overhead is negligible and it reduces the
* performance/stability danger of file-descriptor bloatage. */
#define SESSION_CTX_FLAGS 0
#endif
ctx->dc = DC_CTX_new(ctx->target, SESSION_CTX_FLAGS);
if (!ctx->dc) {
ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, APLOGNO(00738) "distributed scache failed to obtain context");
return APR_EGENERAL;
}
ap_log_error(APLOG_MARK, APLOG_INFO, 0, s, APLOGNO(00739) "distributed scache context initialised");
return APR_SUCCESS;
}
static void socache_dc_destroy(ap_socache_instance_t *ctx, server_rec *s)
{
if (ctx && ctx->dc) {
DC_CTX_free(ctx->dc);
ctx->dc = NULL;
}
}
static apr_status_t socache_dc_store(ap_socache_instance_t *ctx, server_rec *s,
const unsigned char *id, unsigned int idlen,
apr_time_t expiry,
unsigned char *der, unsigned int der_len,
apr_pool_t *p)
{
/* !@#$%^ - why do we deal with *absolute* time anyway???
* Uhm - because most things expire things at a specific time?
* Were the API were thought out expiry - r->request_time is a good approximation
*/
expiry -= apr_time_now();
/* Send the serialised session to the distributed cache context */
if (!DC_CTX_add_session(ctx->dc, id, idlen, der, der_len,
apr_time_msec(expiry))) {
ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, APLOGNO(00740) "distributed scache 'store' failed");
return APR_EGENERAL;
}
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(00741) "distributed scache 'store' successful");
return APR_SUCCESS;
}
static apr_status_t socache_dc_retrieve(ap_socache_instance_t *ctx, server_rec *s,
const unsigned char *id, unsigned int idlen,
unsigned char *dest, unsigned int *destlen,
apr_pool_t *p)
{
unsigned int data_len;
/* Retrieve any corresponding session from the distributed cache context */
if (!DC_CTX_get_session(ctx->dc, id, idlen, dest, *destlen, &data_len)) {
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(00742) "distributed scache 'retrieve' MISS");
return APR_NOTFOUND;
}
if (data_len > *destlen) {
ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, APLOGNO(00743) "distributed scache 'retrieve' OVERFLOW");
return APR_ENOSPC;
}
*destlen = data_len;
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(00744) "distributed scache 'retrieve' HIT");
return APR_SUCCESS;
}
static apr_status_t socache_dc_remove(ap_socache_instance_t *ctx,
server_rec *s, const unsigned char *id,
unsigned int idlen, apr_pool_t *p)
{
/* Remove any corresponding session from the distributed cache context */
if (!DC_CTX_remove_session(ctx->dc, id, idlen)) {
ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, APLOGNO(00745) "distributed scache 'remove' MISS");
return APR_NOTFOUND;
}
else {
ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, APLOGNO(00746) "distributed scache 'remove' HIT");
return APR_SUCCESS;
}
}
static void socache_dc_status(ap_socache_instance_t *ctx, request_rec *r, int flags)
{
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(00747)
"distributed scache 'socache_dc_status'");
if (!(flags & AP_STATUS_SHORT)) {
ap_rprintf(r, "cache type: <b>DC (Distributed Cache)</b>, "
" target: <b>%s</b><br>", ctx->target);
}
else {
ap_rputs("CacheType: DC\n", r);
ap_rvputs(r, "CacheTarget: ", ctx->target, "\n", NULL);
}
}
static apr_status_t socache_dc_iterate(ap_socache_instance_t *instance,
server_rec *s, void *userctx,
ap_socache_iterator_t *iterator,
apr_pool_t *pool)
{
return APR_ENOTIMPL;
}
static const ap_socache_provider_t socache_dc = {
"distcache",
0,
socache_dc_create,
socache_dc_init,
socache_dc_destroy,
socache_dc_store,
socache_dc_retrieve,
socache_dc_remove,
socache_dc_status,
socache_dc_iterate
};
static void register_hooks(apr_pool_t *p)
{
ap_register_provider(p, AP_SOCACHE_PROVIDER_GROUP, "dc",
AP_SOCACHE_PROVIDER_VERSION,
&socache_dc);
}
AP_DECLARE_MODULE(socache_dc) = {
STANDARD20_MODULE_STUFF,
NULL, NULL, NULL, NULL, NULL,
register_hooks
};

55
modules/cache/mod_socache_dc.dep vendored Normal file
View file

@ -0,0 +1,55 @@
# Microsoft Developer Studio Generated Dependency File, included by mod_socache_dc.mak
..\..\build\win32\httpd.rc : \
"..\..\include\ap_release.h"\
.\mod_socache_dc.c : \
"..\..\include\ap_config.h"\
"..\..\include\ap_config_layout.h"\
"..\..\include\ap_hooks.h"\
"..\..\include\ap_mmn.h"\
"..\..\include\ap_provider.h"\
"..\..\include\ap_regex.h"\
"..\..\include\ap_release.h"\
"..\..\include\ap_socache.h"\
"..\..\include\apache_noprobes.h"\
"..\..\include\http_config.h"\
"..\..\include\http_log.h"\
"..\..\include\http_protocol.h"\
"..\..\include\http_request.h"\
"..\..\include\httpd.h"\
"..\..\include\os.h"\
"..\..\include\util_cfgtree.h"\
"..\..\include\util_filter.h"\
"..\..\srclib\apr-util\include\apr_buckets.h"\
"..\..\srclib\apr-util\include\apr_hooks.h"\
"..\..\srclib\apr-util\include\apr_optional.h"\
"..\..\srclib\apr-util\include\apr_optional_hooks.h"\
"..\..\srclib\apr-util\include\apr_uri.h"\
"..\..\srclib\apr-util\include\apu.h"\
"..\..\srclib\apr\include\apr.h"\
"..\..\srclib\apr\include\apr_allocator.h"\
"..\..\srclib\apr\include\apr_dso.h"\
"..\..\srclib\apr\include\apr_errno.h"\
"..\..\srclib\apr\include\apr_file_info.h"\
"..\..\srclib\apr\include\apr_file_io.h"\
"..\..\srclib\apr\include\apr_general.h"\
"..\..\srclib\apr\include\apr_global_mutex.h"\
"..\..\srclib\apr\include\apr_inherit.h"\
"..\..\srclib\apr\include\apr_mmap.h"\
"..\..\srclib\apr\include\apr_network_io.h"\
"..\..\srclib\apr\include\apr_poll.h"\
"..\..\srclib\apr\include\apr_pools.h"\
"..\..\srclib\apr\include\apr_portable.h"\
"..\..\srclib\apr\include\apr_proc_mutex.h"\
"..\..\srclib\apr\include\apr_ring.h"\
"..\..\srclib\apr\include\apr_shm.h"\
"..\..\srclib\apr\include\apr_strings.h"\
"..\..\srclib\apr\include\apr_tables.h"\
"..\..\srclib\apr\include\apr_thread_mutex.h"\
"..\..\srclib\apr\include\apr_thread_proc.h"\
"..\..\srclib\apr\include\apr_time.h"\
"..\..\srclib\apr\include\apr_user.h"\
"..\..\srclib\apr\include\apr_want.h"\

111
modules/cache/mod_socache_dc.dsp vendored Normal file
View file

@ -0,0 +1,111 @@
# Microsoft Developer Studio Project File - Name="mod_socache_dc" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=mod_socache_dc - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "mod_socache_dc.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "mod_socache_dc.mak" CFG="mod_socache_dc - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "mod_socache_dc - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "mod_socache_dc - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "mod_socache_dc - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "mod_socache_dc_EXPORTS" /FD /c
# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../../srclib/apr-util/include" /I "../../srclib/apr/include" /I "../../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Release\mod_socache_dc_src" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /fo"Release/mod_socache_dc.res" /i "../../include" /i "../../srclib/apr/include" /d "NDEBUG" /d BIN_NAME="mod_socache_dc.so" /d LONG_NAME="socache_dc_module for Apache"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll
# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_socache_dc.so" /base:@..\..\os\win32\BaseAddr.ref,mod_socache_dc.so /opt:ref
# Begin Special Build Tool
TargetPath=.\Release\mod_socache_dc.so
SOURCE="$(InputPath)"
PostBuild_Desc=Embed .manifest
PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2
# End Special Build Tool
!ELSEIF "$(CFG)" == "mod_socache_dc - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c
# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../../srclib/apr-util/include" /I "../../srclib/apr/include" /I "../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Debug\mod_socache_dc_src" /FD /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /fo"Debug/mod_socache_dc.res" /i "../../include" /i "../../srclib/apr/include" /d "_DEBUG" /d BIN_NAME="mod_socache_dc.so" /d LONG_NAME="socache_dc_module for Apache"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug
# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_socache_dc.so" /base:@..\..\os\win32\BaseAddr.ref,mod_socache_dc.so
# Begin Special Build Tool
TargetPath=.\Debug\mod_socache_dc.so
SOURCE="$(InputPath)"
PostBuild_Desc=Embed .manifest
PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2
# End Special Build Tool
!ENDIF
# Begin Target
# Name "mod_socache_dc - Win32 Release"
# Name "mod_socache_dc - Win32 Debug"
# Begin Source File
SOURCE=.\mod_socache_dc.c
# End Source File
# Begin Source File
SOURCE=..\..\build\win32\httpd.rc
# End Source File
# End Target
# End Project

353
modules/cache/mod_socache_dc.mak vendored Normal file
View file

@ -0,0 +1,353 @@
# Microsoft Developer Studio Generated NMAKE File, Based on mod_socache_dc.dsp
!IF "$(CFG)" == ""
CFG=mod_socache_dc - Win32 Debug
!MESSAGE No configuration specified. Defaulting to mod_socache_dc - Win32 Debug.
!ENDIF
!IF "$(CFG)" != "mod_socache_dc - Win32 Release" && "$(CFG)" != "mod_socache_dc - Win32 Debug"
!MESSAGE Invalid configuration "$(CFG)" specified.
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "mod_socache_dc.mak" CFG="mod_socache_dc - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "mod_socache_dc - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "mod_socache_dc - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
!ERROR An invalid configuration is specified.
!ENDIF
!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF
!IF "$(CFG)" == "mod_socache_dc - Win32 Release"
OUTDIR=.\Release
INTDIR=.\Release
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
# Begin Custom Macros
OutDir=.\Release
# End Custom Macros
!IF "$(RECURSE)" == "0"
ALL : "$(OUTDIR)\mod_socache_dc.so" "$(DS_POSTBUILD_DEP)"
!ELSE
ALL : "libhttpd - Win32 Release" "libaprutil - Win32 Release" "libapr - Win32 Release" "$(OUTDIR)\mod_socache_dc.so" "$(DS_POSTBUILD_DEP)"
!ENDIF
!IF "$(RECURSE)" == "1"
CLEAN :"libapr - Win32 ReleaseCLEAN" "libaprutil - Win32 ReleaseCLEAN" "libhttpd - Win32 ReleaseCLEAN"
!ELSE
CLEAN :
!ENDIF
-@erase "$(INTDIR)\mod_socache_dc.obj"
-@erase "$(INTDIR)\mod_socache_dc.res"
-@erase "$(INTDIR)\mod_socache_dc_src.idb"
-@erase "$(INTDIR)\mod_socache_dc_src.pdb"
-@erase "$(OUTDIR)\mod_socache_dc.exp"
-@erase "$(OUTDIR)\mod_socache_dc.lib"
-@erase "$(OUTDIR)\mod_socache_dc.pdb"
-@erase "$(OUTDIR)\mod_socache_dc.so"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP=cl.exe
CPP_PROJ=/nologo /MD /W3 /Zi /O2 /Oy- /I "../../srclib/apr-util/include" /I "../../srclib/apr/include" /I "../../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\mod_socache_dc_src" /FD /c
.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
MTL=midl.exe
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
RSC=rc.exe
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\mod_socache_dc.res" /i "../../include" /i "../../srclib/apr/include" /d "NDEBUG" /d BIN_NAME="mod_socache_dc.so" /d LONG_NAME="socache_dc_module for Apache"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\mod_socache_dc.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=kernel32.lib /nologo /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\mod_socache_dc.pdb" /debug /out:"$(OUTDIR)\mod_socache_dc.so" /implib:"$(OUTDIR)\mod_socache_dc.lib" /base:@..\..\os\win32\BaseAddr.ref,mod_socache_dc.so /opt:ref
LINK32_OBJS= \
"$(INTDIR)\mod_socache_dc.obj" \
"$(INTDIR)\mod_socache_dc.res" \
"..\..\srclib\apr\Release\libapr-1.lib" \
"..\..\srclib\apr-util\Release\libaprutil-1.lib" \
"..\..\Release\libhttpd.lib"
"$(OUTDIR)\mod_socache_dc.so" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
TargetPath=.\Release\mod_socache_dc.so
SOURCE="$(InputPath)"
PostBuild_Desc=Embed .manifest
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
# Begin Custom Macros
OutDir=.\Release
# End Custom Macros
"$(DS_POSTBUILD_DEP)" : "$(OUTDIR)\mod_socache_dc.so"
if exist .\Release\mod_socache_dc.so.manifest mt.exe -manifest .\Release\mod_socache_dc.so.manifest -outputresource:.\Release\mod_socache_dc.so;2
echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)"
!ELSEIF "$(CFG)" == "mod_socache_dc - Win32 Debug"
OUTDIR=.\Debug
INTDIR=.\Debug
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
# Begin Custom Macros
OutDir=.\Debug
# End Custom Macros
!IF "$(RECURSE)" == "0"
ALL : "$(OUTDIR)\mod_socache_dc.so" "$(DS_POSTBUILD_DEP)"
!ELSE
ALL : "libhttpd - Win32 Debug" "libaprutil - Win32 Debug" "libapr - Win32 Debug" "$(OUTDIR)\mod_socache_dc.so" "$(DS_POSTBUILD_DEP)"
!ENDIF
!IF "$(RECURSE)" == "1"
CLEAN :"libapr - Win32 DebugCLEAN" "libaprutil - Win32 DebugCLEAN" "libhttpd - Win32 DebugCLEAN"
!ELSE
CLEAN :
!ENDIF
-@erase "$(INTDIR)\mod_socache_dc.obj"
-@erase "$(INTDIR)\mod_socache_dc.res"
-@erase "$(INTDIR)\mod_socache_dc_src.idb"
-@erase "$(INTDIR)\mod_socache_dc_src.pdb"
-@erase "$(OUTDIR)\mod_socache_dc.exp"
-@erase "$(OUTDIR)\mod_socache_dc.lib"
-@erase "$(OUTDIR)\mod_socache_dc.pdb"
-@erase "$(OUTDIR)\mod_socache_dc.so"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP=cl.exe
CPP_PROJ=/nologo /MDd /W3 /Zi /Od /I "../../srclib/apr-util/include" /I "../../srclib/apr/include" /I "../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\mod_socache_dc_src" /FD /EHsc /c
.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
MTL=midl.exe
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
RSC=rc.exe
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\mod_socache_dc.res" /i "../../include" /i "../../srclib/apr/include" /d "_DEBUG" /d BIN_NAME="mod_socache_dc.so" /d LONG_NAME="socache_dc_module for Apache"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\mod_socache_dc.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=kernel32.lib /nologo /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\mod_socache_dc.pdb" /debug /out:"$(OUTDIR)\mod_socache_dc.so" /implib:"$(OUTDIR)\mod_socache_dc.lib" /base:@..\..\os\win32\BaseAddr.ref,mod_socache_dc.so
LINK32_OBJS= \
"$(INTDIR)\mod_socache_dc.obj" \
"$(INTDIR)\mod_socache_dc.res" \
"..\..\srclib\apr\Debug\libapr-1.lib" \
"..\..\srclib\apr-util\Debug\libaprutil-1.lib" \
"..\..\Debug\libhttpd.lib"
"$(OUTDIR)\mod_socache_dc.so" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
TargetPath=.\Debug\mod_socache_dc.so
SOURCE="$(InputPath)"
PostBuild_Desc=Embed .manifest
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
# Begin Custom Macros
OutDir=.\Debug
# End Custom Macros
"$(DS_POSTBUILD_DEP)" : "$(OUTDIR)\mod_socache_dc.so"
if exist .\Debug\mod_socache_dc.so.manifest mt.exe -manifest .\Debug\mod_socache_dc.so.manifest -outputresource:.\Debug\mod_socache_dc.so;2
echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)"
!ENDIF
!IF "$(NO_EXTERNAL_DEPS)" != "1"
!IF EXISTS("mod_socache_dc.dep")
!INCLUDE "mod_socache_dc.dep"
!ELSE
!MESSAGE Warning: cannot find "mod_socache_dc.dep"
!ENDIF
!ENDIF
!IF "$(CFG)" == "mod_socache_dc - Win32 Release" || "$(CFG)" == "mod_socache_dc - Win32 Debug"
!IF "$(CFG)" == "mod_socache_dc - Win32 Release"
"libapr - Win32 Release" :
cd ".\..\..\srclib\apr"
$(MAKE) /$(MAKEFLAGS) /F ".\libapr.mak" CFG="libapr - Win32 Release"
cd "..\..\modules\cache"
"libapr - Win32 ReleaseCLEAN" :
cd ".\..\..\srclib\apr"
$(MAKE) /$(MAKEFLAGS) /F ".\libapr.mak" CFG="libapr - Win32 Release" RECURSE=1 CLEAN
cd "..\..\modules\cache"
!ELSEIF "$(CFG)" == "mod_socache_dc - Win32 Debug"
"libapr - Win32 Debug" :
cd ".\..\..\srclib\apr"
$(MAKE) /$(MAKEFLAGS) /F ".\libapr.mak" CFG="libapr - Win32 Debug"
cd "..\..\modules\cache"
"libapr - Win32 DebugCLEAN" :
cd ".\..\..\srclib\apr"
$(MAKE) /$(MAKEFLAGS) /F ".\libapr.mak" CFG="libapr - Win32 Debug" RECURSE=1 CLEAN
cd "..\..\modules\cache"
!ENDIF
!IF "$(CFG)" == "mod_socache_dc - Win32 Release"
"libaprutil - Win32 Release" :
cd ".\..\..\srclib\apr-util"
$(MAKE) /$(MAKEFLAGS) /F ".\libaprutil.mak" CFG="libaprutil - Win32 Release"
cd "..\..\modules\cache"
"libaprutil - Win32 ReleaseCLEAN" :
cd ".\..\..\srclib\apr-util"
$(MAKE) /$(MAKEFLAGS) /F ".\libaprutil.mak" CFG="libaprutil - Win32 Release" RECURSE=1 CLEAN
cd "..\..\modules\cache"
!ELSEIF "$(CFG)" == "mod_socache_dc - Win32 Debug"
"libaprutil - Win32 Debug" :
cd ".\..\..\srclib\apr-util"
$(MAKE) /$(MAKEFLAGS) /F ".\libaprutil.mak" CFG="libaprutil - Win32 Debug"
cd "..\..\modules\cache"
"libaprutil - Win32 DebugCLEAN" :
cd ".\..\..\srclib\apr-util"
$(MAKE) /$(MAKEFLAGS) /F ".\libaprutil.mak" CFG="libaprutil - Win32 Debug" RECURSE=1 CLEAN
cd "..\..\modules\cache"
!ENDIF
!IF "$(CFG)" == "mod_socache_dc - Win32 Release"
"libhttpd - Win32 Release" :
cd ".\..\.."
$(MAKE) /$(MAKEFLAGS) /F ".\libhttpd.mak" CFG="libhttpd - Win32 Release"
cd ".\modules\cache"
"libhttpd - Win32 ReleaseCLEAN" :
cd ".\..\.."
$(MAKE) /$(MAKEFLAGS) /F ".\libhttpd.mak" CFG="libhttpd - Win32 Release" RECURSE=1 CLEAN
cd ".\modules\cache"
!ELSEIF "$(CFG)" == "mod_socache_dc - Win32 Debug"
"libhttpd - Win32 Debug" :
cd ".\..\.."
$(MAKE) /$(MAKEFLAGS) /F ".\libhttpd.mak" CFG="libhttpd - Win32 Debug"
cd ".\modules\cache"
"libhttpd - Win32 DebugCLEAN" :
cd ".\..\.."
$(MAKE) /$(MAKEFLAGS) /F ".\libhttpd.mak" CFG="libhttpd - Win32 Debug" RECURSE=1 CLEAN
cd ".\modules\cache"
!ENDIF
SOURCE=..\..\build\win32\httpd.rc
!IF "$(CFG)" == "mod_socache_dc - Win32 Release"
"$(INTDIR)\mod_socache_dc.res" : $(SOURCE) "$(INTDIR)"
$(RSC) /l 0x409 /fo"$(INTDIR)\mod_socache_dc.res" /i "../../include" /i "../../srclib/apr/include" /i "../../build\win32" /d "NDEBUG" /d BIN_NAME="mod_socache_dc.so" /d LONG_NAME="socache_dc_module for Apache" $(SOURCE)
!ELSEIF "$(CFG)" == "mod_socache_dc - Win32 Debug"
"$(INTDIR)\mod_socache_dc.res" : $(SOURCE) "$(INTDIR)"
$(RSC) /l 0x409 /fo"$(INTDIR)\mod_socache_dc.res" /i "../../include" /i "../../srclib/apr/include" /i "../../build\win32" /d "_DEBUG" /d BIN_NAME="mod_socache_dc.so" /d LONG_NAME="socache_dc_module for Apache" $(SOURCE)
!ENDIF
SOURCE=.\mod_socache_dc.c
"$(INTDIR)\mod_socache_dc.obj" : $(SOURCE) "$(INTDIR)"
!ENDIF

418
modules/cache/mod_socache_memcache.c vendored Normal file
View file

@ -0,0 +1,418 @@
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "httpd.h"
#include "http_config.h"
#include "http_protocol.h"
#include "apr.h"
#include "ap_socache.h"
#include "ap_mpm.h"
#include "http_log.h"
#include "apr_memcache.h"
#include "apr_strings.h"
#include "mod_status.h"
/* The underlying apr_memcache system is thread safe.. */
#define MC_KEY_LEN 254
#ifndef MC_DEFAULT_SERVER_PORT
#define MC_DEFAULT_SERVER_PORT 11211
#endif
#ifndef MC_DEFAULT_SERVER_MIN
#define MC_DEFAULT_SERVER_MIN 0
#endif
#ifndef MC_DEFAULT_SERVER_SMAX
#define MC_DEFAULT_SERVER_SMAX 1
#endif
#ifndef MC_DEFAULT_SERVER_TTL
#define MC_DEFAULT_SERVER_TTL apr_time_from_sec(15)
#endif
module AP_MODULE_DECLARE_DATA socache_memcache_module;
typedef struct {
apr_uint32_t ttl;
} socache_mc_svr_cfg;
struct ap_socache_instance_t {
const char *servers;
apr_memcache_t *mc;
const char *tag;
apr_size_t taglen; /* strlen(tag) + 1 */
};
static const char *socache_mc_create(ap_socache_instance_t **context,
const char *arg,
apr_pool_t *tmp, apr_pool_t *p)
{
ap_socache_instance_t *ctx;
*context = ctx = apr_palloc(p, sizeof *ctx);
if (!arg || !*arg) {
return "List of server names required to create memcache socache.";
}
ctx->servers = apr_pstrdup(p, arg);
return NULL;
}
static apr_status_t socache_mc_init(ap_socache_instance_t *ctx,
const char *namespace,
const struct ap_socache_hints *hints,
server_rec *s, apr_pool_t *p)
{
apr_status_t rv;
int thread_limit = 0;
apr_uint16_t nservers = 0;
char *cache_config;
char *split;
char *tok;
socache_mc_svr_cfg *sconf = ap_get_module_config(s->module_config,
&socache_memcache_module);
ap_mpm_query(AP_MPMQ_HARD_LIMIT_THREADS, &thread_limit);
/* Find all the servers in the first run to get a total count */
cache_config = apr_pstrdup(p, ctx->servers);
split = apr_strtok(cache_config, ",", &tok);
while (split) {
nservers++;
split = apr_strtok(NULL,",", &tok);
}
rv = apr_memcache_create(p, nservers, 0, &ctx->mc);
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s, APLOGNO(00785)
"Failed to create Memcache Object of '%d' size.",
nservers);
return rv;
}
/* Now add each server to the memcache */
cache_config = apr_pstrdup(p, ctx->servers);
split = apr_strtok(cache_config, ",", &tok);
while (split) {
apr_memcache_server_t *st;
char *host_str;
char *scope_id;
apr_port_t port;
rv = apr_parse_addr_port(&host_str, &scope_id, &port, split, p);
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s, APLOGNO(00786)
"Failed to Parse memcache Server: '%s'", split);
return rv;
}
if (host_str == NULL) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s, APLOGNO(00787)
"Failed to Parse Server, "
"no hostname specified: '%s'", split);
return APR_EINVAL;
}
if (port == 0) {
port = MC_DEFAULT_SERVER_PORT;
}
rv = apr_memcache_server_create(p,
host_str, port,
MC_DEFAULT_SERVER_MIN,
MC_DEFAULT_SERVER_SMAX,
thread_limit,
sconf->ttl,
&st);
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s, APLOGNO(00788)
"Failed to Create memcache Server: %s:%d",
host_str, port);
return rv;
}
rv = apr_memcache_add_server(ctx->mc, st);
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s, APLOGNO(00789)
"Failed to Add memcache Server: %s:%d",
host_str, port);
return rv;
}
split = apr_strtok(NULL,",", &tok);
}
ctx->tag = apr_pstrcat(p, namespace, ":", NULL);
ctx->taglen = strlen(ctx->tag) + 1;
/* socache API constraint: */
AP_DEBUG_ASSERT(ctx->taglen <= 16);
return APR_SUCCESS;
}
static void socache_mc_destroy(ap_socache_instance_t *context, server_rec *s)
{
/* noop. */
}
/* Converts (binary) id into a key prefixed by the predetermined
* namespace tag; writes output to key buffer. Returns non-zero if
* the id won't fit in the key buffer. */
static int socache_mc_id2key(ap_socache_instance_t *ctx,
const unsigned char *id, unsigned int idlen,
char *key, apr_size_t keylen)
{
char *cp;
if (idlen * 2 + ctx->taglen >= keylen)
return 1;
cp = apr_cpystrn(key, ctx->tag, ctx->taglen);
ap_bin2hex(id, idlen, cp);
return 0;
}
static apr_status_t socache_mc_store(ap_socache_instance_t *ctx, server_rec *s,
const unsigned char *id, unsigned int idlen,
apr_time_t expiry,
unsigned char *ucaData, unsigned int nData,
apr_pool_t *p)
{
char buf[MC_KEY_LEN];
apr_status_t rv;
if (socache_mc_id2key(ctx, id, idlen, buf, sizeof buf)) {
return APR_EINVAL;
}
/* memcache needs time in seconds till expiry; fail if this is not
* positive *before* casting to unsigned (apr_uint32_t). */
expiry -= apr_time_now();
if (apr_time_sec(expiry) <= 0) {
return APR_EINVAL;
}
rv = apr_memcache_set(ctx->mc, buf, (char*)ucaData, nData,
apr_time_sec(expiry), 0);
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s, APLOGNO(00790)
"scache_mc: error setting key '%s' "
"with %d bytes of data", buf, nData);
return rv;
}
return APR_SUCCESS;
}
static apr_status_t socache_mc_retrieve(ap_socache_instance_t *ctx, server_rec *s,
const unsigned char *id, unsigned int idlen,
unsigned char *dest, unsigned int *destlen,
apr_pool_t *p)
{
apr_size_t data_len;
char buf[MC_KEY_LEN], *data;
apr_status_t rv;
if (socache_mc_id2key(ctx, id, idlen, buf, sizeof buf)) {
return APR_EINVAL;
}
/* ### this could do with a subpool, but _getp looks like it will
* eat memory like it's going out of fashion anyway. */
rv = apr_memcache_getp(ctx->mc, p, buf, &data, &data_len, NULL);
if (rv) {
if (rv != APR_NOTFOUND) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(00791)
"scache_mc: 'retrieve' FAIL");
}
return rv;
}
else if (data_len > *destlen) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(00792)
"scache_mc: 'retrieve' OVERFLOW");
return APR_ENOMEM;
}
memcpy(dest, data, data_len);
*destlen = data_len;
return APR_SUCCESS;
}
static apr_status_t socache_mc_remove(ap_socache_instance_t *ctx, server_rec *s,
const unsigned char *id,
unsigned int idlen, apr_pool_t *p)
{
char buf[MC_KEY_LEN];
apr_status_t rv;
if (socache_mc_id2key(ctx, id, idlen, buf, sizeof buf)) {
return APR_EINVAL;
}
rv = apr_memcache_delete(ctx->mc, buf, 0);
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, s, APLOGNO(00793)
"scache_mc: error deleting key '%s' ",
buf);
}
return rv;
}
static void socache_mc_status(ap_socache_instance_t *ctx, request_rec *r, int flags)
{
apr_memcache_t *rc = ctx->mc;
int i;
for (i = 0; i < rc->ntotal; i++) {
apr_memcache_server_t *ms;
apr_memcache_stats_t *stats;
apr_status_t rv;
char *br = (!(flags & AP_STATUS_SHORT) ? "<br />" : "");
ms = rc->live_servers[i];
ap_rprintf(r, "Memcached server: %s:%d [%s]%s\n", ms->host, (int)ms->port,
(ms->status == APR_MC_SERVER_LIVE) ? "Up" : "Down",
br);
rv = apr_memcache_stats(ms, r->pool, &stats);
if (rv != APR_SUCCESS)
continue;
if (!(flags & AP_STATUS_SHORT)) {
ap_rprintf(r, "<b>Version:</b> <i>%s</i> [%u bits], PID: <i>%u</i>, Uptime: <i>%u hrs</i> <br />\n",
stats->version , stats->pointer_size, stats->pid, stats->uptime/3600);
ap_rprintf(r, "<b>Clients::</b> Structures: <i>%u</i>, Total: <i>%u</i>, Current: <i>%u</i> <br />\n",
stats->connection_structures, stats->total_connections, stats->curr_connections);
ap_rprintf(r, "<b>Storage::</b> Total Items: <i>%u</i>, Current Items: <i>%u</i>, Bytes: <i>%" APR_UINT64_T_FMT "</i> <br />\n",
stats->total_items, stats->curr_items, stats->bytes);
ap_rprintf(r, "<b>CPU::</b> System: <i>%u</i>, User: <i>%u</i> <br />\n",
(unsigned)stats->rusage_system, (unsigned)stats->rusage_user );
ap_rprintf(r, "<b>Cache::</b> Gets: <i>%u</i>, Sets: <i>%u</i>, Hits: <i>%u</i>, Misses: <i>%u</i> <br />\n",
stats->cmd_get, stats->cmd_set, stats->get_hits, stats->get_misses);
ap_rprintf(r, "<b>Net::</b> Input bytes: <i>%" APR_UINT64_T_FMT "</i>, Output bytes: <i>%" APR_UINT64_T_FMT "</i> <br />\n",
stats->bytes_read, stats->bytes_written);
ap_rprintf(r, "<b>Misc::</b> Evictions: <i>%" APR_UINT64_T_FMT "</i>, MaxMem: <i>%u</i>, Threads: <i>%u</i> <br />\n",
stats->evictions, stats->limit_maxbytes, stats->threads);
ap_rputs("<hr><br />\n", r);
}
else {
ap_rprintf(r, "Version: %s [%u bits], PID: %u, Uptime: %u hrs %s\n",
stats->version , stats->pointer_size, stats->pid, stats->uptime/3600, br);
ap_rprintf(r, "Clients:: Structures: %d, Total: %d, Current: %u %s\n",
stats->connection_structures, stats->total_connections, stats->curr_connections, br);
ap_rprintf(r, "Storage:: Total Items: %u, Current Items: %u, Bytes: %" APR_UINT64_T_FMT " %s\n",
stats->total_items, stats->curr_items, stats->bytes, br);
ap_rprintf(r, "CPU:: System: %u, User: %u %s\n",
(unsigned)stats->rusage_system, (unsigned)stats->rusage_user , br);
ap_rprintf(r, "Cache:: Gets: %u, Sets: %u, Hits: %u, Misses: %u %s\n",
stats->cmd_get, stats->cmd_set, stats->get_hits, stats->get_misses, br);
ap_rprintf(r, "Net:: Input bytes: %" APR_UINT64_T_FMT ", Output bytes: %" APR_UINT64_T_FMT " %s\n",
stats->bytes_read, stats->bytes_written, br);
ap_rprintf(r, "Misc:: Evictions: %" APR_UINT64_T_FMT ", MaxMem: %u, Threads: %u %s\n",
stats->evictions, stats->limit_maxbytes, stats->threads, br);
}
}
}
static apr_status_t socache_mc_iterate(ap_socache_instance_t *instance,
server_rec *s, void *userctx,
ap_socache_iterator_t *iterator,
apr_pool_t *pool)
{
return APR_ENOTIMPL;
}
static const ap_socache_provider_t socache_mc = {
"memcache",
0,
socache_mc_create,
socache_mc_init,
socache_mc_destroy,
socache_mc_store,
socache_mc_retrieve,
socache_mc_remove,
socache_mc_status,
socache_mc_iterate
};
static void *create_server_config(apr_pool_t *p, server_rec *s)
{
socache_mc_svr_cfg *sconf = apr_pcalloc(p, sizeof(socache_mc_svr_cfg));
sconf->ttl = MC_DEFAULT_SERVER_TTL;
return sconf;
}
static const char *socache_mc_set_ttl(cmd_parms *cmd, void *dummy,
const char *arg)
{
apr_interval_time_t ttl;
socache_mc_svr_cfg *sconf = ap_get_module_config(cmd->server->module_config,
&socache_memcache_module);
if (ap_timeout_parameter_parse(arg, &ttl, "s") != APR_SUCCESS) {
return apr_pstrcat(cmd->pool, cmd->cmd->name,
" has wrong format", NULL);
}
if ((ttl < apr_time_from_sec(0)) || (ttl > apr_time_from_sec(3600))) {
return apr_pstrcat(cmd->pool, cmd->cmd->name,
" can only be 0 or up to one hour.", NULL);
}
/* apr_memcache_server_create needs a ttl in usec. */
sconf->ttl = ttl;
return NULL;
}
static void register_hooks(apr_pool_t *p)
{
ap_register_provider(p, AP_SOCACHE_PROVIDER_GROUP, "memcache",
AP_SOCACHE_PROVIDER_VERSION,
&socache_mc);
}
static const command_rec socache_memcache_cmds[] = {
AP_INIT_TAKE1("MemcacheConnTTL", socache_mc_set_ttl, NULL, RSRC_CONF,
"TTL used for the connection with the memcache server(s)"),
{ NULL }
};
AP_DECLARE_MODULE(socache_memcache) = {
STANDARD20_MODULE_STUFF,
NULL, /* create per-dir config structures */
NULL, /* merge per-dir config structures */
create_server_config, /* create per-server config structures */
NULL, /* merge per-server config structures */
socache_memcache_cmds, /* table of config file commands */
register_hooks /* register hooks */
};

59
modules/cache/mod_socache_memcache.dep vendored Normal file
View file

@ -0,0 +1,59 @@
# Microsoft Developer Studio Generated Dependency File, included by mod_socache_memcache.mak
..\..\build\win32\httpd.rc : \
"..\..\include\ap_release.h"\
.\mod_socache_memcache.c : \
"..\..\include\ap_config.h"\
"..\..\include\ap_config_layout.h"\
"..\..\include\ap_hooks.h"\
"..\..\include\ap_mmn.h"\
"..\..\include\ap_mpm.h"\
"..\..\include\ap_provider.h"\
"..\..\include\ap_regex.h"\
"..\..\include\ap_release.h"\
"..\..\include\ap_socache.h"\
"..\..\include\apache_noprobes.h"\
"..\..\include\http_config.h"\
"..\..\include\http_log.h"\
"..\..\include\httpd.h"\
"..\..\include\os.h"\
"..\..\include\scoreboard.h"\
"..\..\include\util_cfgtree.h"\
"..\..\srclib\apr-util\include\apr_buckets.h"\
"..\..\srclib\apr-util\include\apr_hooks.h"\
"..\..\srclib\apr-util\include\apr_memcache.h"\
"..\..\srclib\apr-util\include\apr_optional.h"\
"..\..\srclib\apr-util\include\apr_optional_hooks.h"\
"..\..\srclib\apr-util\include\apr_reslist.h"\
"..\..\srclib\apr-util\include\apr_uri.h"\
"..\..\srclib\apr-util\include\apu.h"\
"..\..\srclib\apr-util\include\apu_version.h"\
"..\..\srclib\apr\include\apr.h"\
"..\..\srclib\apr\include\apr_allocator.h"\
"..\..\srclib\apr\include\apr_dso.h"\
"..\..\srclib\apr\include\apr_errno.h"\
"..\..\srclib\apr\include\apr_file_info.h"\
"..\..\srclib\apr\include\apr_file_io.h"\
"..\..\srclib\apr\include\apr_general.h"\
"..\..\srclib\apr\include\apr_global_mutex.h"\
"..\..\srclib\apr\include\apr_hash.h"\
"..\..\srclib\apr\include\apr_inherit.h"\
"..\..\srclib\apr\include\apr_mmap.h"\
"..\..\srclib\apr\include\apr_network_io.h"\
"..\..\srclib\apr\include\apr_poll.h"\
"..\..\srclib\apr\include\apr_pools.h"\
"..\..\srclib\apr\include\apr_portable.h"\
"..\..\srclib\apr\include\apr_proc_mutex.h"\
"..\..\srclib\apr\include\apr_ring.h"\
"..\..\srclib\apr\include\apr_shm.h"\
"..\..\srclib\apr\include\apr_strings.h"\
"..\..\srclib\apr\include\apr_tables.h"\
"..\..\srclib\apr\include\apr_thread_mutex.h"\
"..\..\srclib\apr\include\apr_thread_proc.h"\
"..\..\srclib\apr\include\apr_time.h"\
"..\..\srclib\apr\include\apr_user.h"\
"..\..\srclib\apr\include\apr_version.h"\
"..\..\srclib\apr\include\apr_want.h"\

111
modules/cache/mod_socache_memcache.dsp vendored Normal file
View file

@ -0,0 +1,111 @@
# Microsoft Developer Studio Project File - Name="mod_socache_memcache" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=mod_socache_memcache - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "mod_socache_memcache.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "mod_socache_memcache.mak" CFG="mod_socache_memcache - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "mod_socache_memcache - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "mod_socache_memcache - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "mod_socache_memcache - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "mod_socache_memcache_EXPORTS" /FD /c
# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../../srclib/apr-util/include" /I "../../srclib/apr/include" /I "../../include" /I "../generators" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Release\mod_socache_memcache_src" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /fo"Release/mod_socache_memcache.res" /i "../../include" /i "../../srclib/apr/include" /d "NDEBUG" /d BIN_NAME="mod_socache_memcache.so" /d LONG_NAME="socache_memcache_module for Apache"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll
# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_socache_memcache.so" /base:@..\..\os\win32\BaseAddr.ref,mod_socache_memcache.so /opt:ref
# Begin Special Build Tool
TargetPath=.\Release\mod_socache_memcache.so
SOURCE="$(InputPath)"
PostBuild_Desc=Embed .manifest
PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2
# End Special Build Tool
!ELSEIF "$(CFG)" == "mod_socache_memcache - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c
# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../../srclib/apr-util/include" /I "../../srclib/apr/include" /I "../../include" /I "../generators" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Debug\mod_socache_memcache_src" /FD /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /fo"Debug/mod_socache_memcache.res" /i "../../include" /i "../../srclib/apr/include" /d "_DEBUG" /d BIN_NAME="mod_socache_memcache.so" /d LONG_NAME="socache_memcache_module for Apache"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug
# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_socache_memcache.so" /base:@..\..\os\win32\BaseAddr.ref,mod_socache_memcache.so
# Begin Special Build Tool
TargetPath=.\Debug\mod_socache_memcache.so
SOURCE="$(InputPath)"
PostBuild_Desc=Embed .manifest
PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2
# End Special Build Tool
!ENDIF
# Begin Target
# Name "mod_socache_memcache - Win32 Release"
# Name "mod_socache_memcache - Win32 Debug"
# Begin Source File
SOURCE=.\mod_socache_memcache.c
# End Source File
# Begin Source File
SOURCE=..\..\build\win32\httpd.rc
# End Source File
# End Target
# End Project

353
modules/cache/mod_socache_memcache.mak vendored Normal file
View file

@ -0,0 +1,353 @@
# Microsoft Developer Studio Generated NMAKE File, Based on mod_socache_memcache.dsp
!IF "$(CFG)" == ""
CFG=mod_socache_memcache - Win32 Debug
!MESSAGE No configuration specified. Defaulting to mod_socache_memcache - Win32 Debug.
!ENDIF
!IF "$(CFG)" != "mod_socache_memcache - Win32 Release" && "$(CFG)" != "mod_socache_memcache - Win32 Debug"
!MESSAGE Invalid configuration "$(CFG)" specified.
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "mod_socache_memcache.mak" CFG="mod_socache_memcache - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "mod_socache_memcache - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "mod_socache_memcache - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
!ERROR An invalid configuration is specified.
!ENDIF
!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF
!IF "$(CFG)" == "mod_socache_memcache - Win32 Release"
OUTDIR=.\Release
INTDIR=.\Release
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
# Begin Custom Macros
OutDir=.\Release
# End Custom Macros
!IF "$(RECURSE)" == "0"
ALL : "$(OUTDIR)\mod_socache_memcache.so" "$(DS_POSTBUILD_DEP)"
!ELSE
ALL : "libhttpd - Win32 Release" "libaprutil - Win32 Release" "libapr - Win32 Release" "$(OUTDIR)\mod_socache_memcache.so" "$(DS_POSTBUILD_DEP)"
!ENDIF
!IF "$(RECURSE)" == "1"
CLEAN :"libapr - Win32 ReleaseCLEAN" "libaprutil - Win32 ReleaseCLEAN" "libhttpd - Win32 ReleaseCLEAN"
!ELSE
CLEAN :
!ENDIF
-@erase "$(INTDIR)\mod_socache_memcache.obj"
-@erase "$(INTDIR)\mod_socache_memcache.res"
-@erase "$(INTDIR)\mod_socache_memcache_src.idb"
-@erase "$(INTDIR)\mod_socache_memcache_src.pdb"
-@erase "$(OUTDIR)\mod_socache_memcache.exp"
-@erase "$(OUTDIR)\mod_socache_memcache.lib"
-@erase "$(OUTDIR)\mod_socache_memcache.pdb"
-@erase "$(OUTDIR)\mod_socache_memcache.so"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP=cl.exe
CPP_PROJ=/nologo /MD /W3 /Zi /O2 /Oy- /I "../../srclib/apr-util/include" /I "../../srclib/apr/include" /I "../../include" /I "../generators" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\mod_socache_memcache_src" /FD /c
.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
MTL=midl.exe
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
RSC=rc.exe
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\mod_socache_memcache.res" /i "../../include" /i "../../srclib/apr/include" /d "NDEBUG" /d BIN_NAME="mod_socache_memcache.so" /d LONG_NAME="socache_memcache_module for Apache"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\mod_socache_memcache.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=kernel32.lib /nologo /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\mod_socache_memcache.pdb" /debug /out:"$(OUTDIR)\mod_socache_memcache.so" /implib:"$(OUTDIR)\mod_socache_memcache.lib" /base:@..\..\os\win32\BaseAddr.ref,mod_socache_memcache.so /opt:ref
LINK32_OBJS= \
"$(INTDIR)\mod_socache_memcache.obj" \
"$(INTDIR)\mod_socache_memcache.res" \
"..\..\srclib\apr\Release\libapr-1.lib" \
"..\..\srclib\apr-util\Release\libaprutil-1.lib" \
"..\..\Release\libhttpd.lib"
"$(OUTDIR)\mod_socache_memcache.so" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
TargetPath=.\Release\mod_socache_memcache.so
SOURCE="$(InputPath)"
PostBuild_Desc=Embed .manifest
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
# Begin Custom Macros
OutDir=.\Release
# End Custom Macros
"$(DS_POSTBUILD_DEP)" : "$(OUTDIR)\mod_socache_memcache.so"
if exist .\Release\mod_socache_memcache.so.manifest mt.exe -manifest .\Release\mod_socache_memcache.so.manifest -outputresource:.\Release\mod_socache_memcache.so;2
echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)"
!ELSEIF "$(CFG)" == "mod_socache_memcache - Win32 Debug"
OUTDIR=.\Debug
INTDIR=.\Debug
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
# Begin Custom Macros
OutDir=.\Debug
# End Custom Macros
!IF "$(RECURSE)" == "0"
ALL : "$(OUTDIR)\mod_socache_memcache.so" "$(DS_POSTBUILD_DEP)"
!ELSE
ALL : "libhttpd - Win32 Debug" "libaprutil - Win32 Debug" "libapr - Win32 Debug" "$(OUTDIR)\mod_socache_memcache.so" "$(DS_POSTBUILD_DEP)"
!ENDIF
!IF "$(RECURSE)" == "1"
CLEAN :"libapr - Win32 DebugCLEAN" "libaprutil - Win32 DebugCLEAN" "libhttpd - Win32 DebugCLEAN"
!ELSE
CLEAN :
!ENDIF
-@erase "$(INTDIR)\mod_socache_memcache.obj"
-@erase "$(INTDIR)\mod_socache_memcache.res"
-@erase "$(INTDIR)\mod_socache_memcache_src.idb"
-@erase "$(INTDIR)\mod_socache_memcache_src.pdb"
-@erase "$(OUTDIR)\mod_socache_memcache.exp"
-@erase "$(OUTDIR)\mod_socache_memcache.lib"
-@erase "$(OUTDIR)\mod_socache_memcache.pdb"
-@erase "$(OUTDIR)\mod_socache_memcache.so"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP=cl.exe
CPP_PROJ=/nologo /MDd /W3 /Zi /Od /I "../../srclib/apr-util/include" /I "../../srclib/apr/include" /I "../../include" /I "../generators" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\mod_socache_memcache_src" /FD /EHsc /c
.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
MTL=midl.exe
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
RSC=rc.exe
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\mod_socache_memcache.res" /i "../../include" /i "../../srclib/apr/include" /d "_DEBUG" /d BIN_NAME="mod_socache_memcache.so" /d LONG_NAME="socache_memcache_module for Apache"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\mod_socache_memcache.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=kernel32.lib /nologo /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\mod_socache_memcache.pdb" /debug /out:"$(OUTDIR)\mod_socache_memcache.so" /implib:"$(OUTDIR)\mod_socache_memcache.lib" /base:@..\..\os\win32\BaseAddr.ref,mod_socache_memcache.so
LINK32_OBJS= \
"$(INTDIR)\mod_socache_memcache.obj" \
"$(INTDIR)\mod_socache_memcache.res" \
"..\..\srclib\apr\Debug\libapr-1.lib" \
"..\..\srclib\apr-util\Debug\libaprutil-1.lib" \
"..\..\Debug\libhttpd.lib"
"$(OUTDIR)\mod_socache_memcache.so" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
TargetPath=.\Debug\mod_socache_memcache.so
SOURCE="$(InputPath)"
PostBuild_Desc=Embed .manifest
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
# Begin Custom Macros
OutDir=.\Debug
# End Custom Macros
"$(DS_POSTBUILD_DEP)" : "$(OUTDIR)\mod_socache_memcache.so"
if exist .\Debug\mod_socache_memcache.so.manifest mt.exe -manifest .\Debug\mod_socache_memcache.so.manifest -outputresource:.\Debug\mod_socache_memcache.so;2
echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)"
!ENDIF
!IF "$(NO_EXTERNAL_DEPS)" != "1"
!IF EXISTS("mod_socache_memcache.dep")
!INCLUDE "mod_socache_memcache.dep"
!ELSE
!MESSAGE Warning: cannot find "mod_socache_memcache.dep"
!ENDIF
!ENDIF
!IF "$(CFG)" == "mod_socache_memcache - Win32 Release" || "$(CFG)" == "mod_socache_memcache - Win32 Debug"
!IF "$(CFG)" == "mod_socache_memcache - Win32 Release"
"libapr - Win32 Release" :
cd ".\..\..\srclib\apr"
$(MAKE) /$(MAKEFLAGS) /F ".\libapr.mak" CFG="libapr - Win32 Release"
cd "..\..\modules\cache"
"libapr - Win32 ReleaseCLEAN" :
cd ".\..\..\srclib\apr"
$(MAKE) /$(MAKEFLAGS) /F ".\libapr.mak" CFG="libapr - Win32 Release" RECURSE=1 CLEAN
cd "..\..\modules\cache"
!ELSEIF "$(CFG)" == "mod_socache_memcache - Win32 Debug"
"libapr - Win32 Debug" :
cd ".\..\..\srclib\apr"
$(MAKE) /$(MAKEFLAGS) /F ".\libapr.mak" CFG="libapr - Win32 Debug"
cd "..\..\modules\cache"
"libapr - Win32 DebugCLEAN" :
cd ".\..\..\srclib\apr"
$(MAKE) /$(MAKEFLAGS) /F ".\libapr.mak" CFG="libapr - Win32 Debug" RECURSE=1 CLEAN
cd "..\..\modules\cache"
!ENDIF
!IF "$(CFG)" == "mod_socache_memcache - Win32 Release"
"libaprutil - Win32 Release" :
cd ".\..\..\srclib\apr-util"
$(MAKE) /$(MAKEFLAGS) /F ".\libaprutil.mak" CFG="libaprutil - Win32 Release"
cd "..\..\modules\cache"
"libaprutil - Win32 ReleaseCLEAN" :
cd ".\..\..\srclib\apr-util"
$(MAKE) /$(MAKEFLAGS) /F ".\libaprutil.mak" CFG="libaprutil - Win32 Release" RECURSE=1 CLEAN
cd "..\..\modules\cache"
!ELSEIF "$(CFG)" == "mod_socache_memcache - Win32 Debug"
"libaprutil - Win32 Debug" :
cd ".\..\..\srclib\apr-util"
$(MAKE) /$(MAKEFLAGS) /F ".\libaprutil.mak" CFG="libaprutil - Win32 Debug"
cd "..\..\modules\cache"
"libaprutil - Win32 DebugCLEAN" :
cd ".\..\..\srclib\apr-util"
$(MAKE) /$(MAKEFLAGS) /F ".\libaprutil.mak" CFG="libaprutil - Win32 Debug" RECURSE=1 CLEAN
cd "..\..\modules\cache"
!ENDIF
!IF "$(CFG)" == "mod_socache_memcache - Win32 Release"
"libhttpd - Win32 Release" :
cd ".\..\.."
$(MAKE) /$(MAKEFLAGS) /F ".\libhttpd.mak" CFG="libhttpd - Win32 Release"
cd ".\modules\cache"
"libhttpd - Win32 ReleaseCLEAN" :
cd ".\..\.."
$(MAKE) /$(MAKEFLAGS) /F ".\libhttpd.mak" CFG="libhttpd - Win32 Release" RECURSE=1 CLEAN
cd ".\modules\cache"
!ELSEIF "$(CFG)" == "mod_socache_memcache - Win32 Debug"
"libhttpd - Win32 Debug" :
cd ".\..\.."
$(MAKE) /$(MAKEFLAGS) /F ".\libhttpd.mak" CFG="libhttpd - Win32 Debug"
cd ".\modules\cache"
"libhttpd - Win32 DebugCLEAN" :
cd ".\..\.."
$(MAKE) /$(MAKEFLAGS) /F ".\libhttpd.mak" CFG="libhttpd - Win32 Debug" RECURSE=1 CLEAN
cd ".\modules\cache"
!ENDIF
SOURCE=..\..\build\win32\httpd.rc
!IF "$(CFG)" == "mod_socache_memcache - Win32 Release"
"$(INTDIR)\mod_socache_memcache.res" : $(SOURCE) "$(INTDIR)"
$(RSC) /l 0x409 /fo"$(INTDIR)\mod_socache_memcache.res" /i "../../include" /i "../../srclib/apr/include" /i "../../build\win32" /d "NDEBUG" /d BIN_NAME="mod_socache_memcache.so" /d LONG_NAME="socache_memcache_module for Apache" $(SOURCE)
!ELSEIF "$(CFG)" == "mod_socache_memcache - Win32 Debug"
"$(INTDIR)\mod_socache_memcache.res" : $(SOURCE) "$(INTDIR)"
$(RSC) /l 0x409 /fo"$(INTDIR)\mod_socache_memcache.res" /i "../../include" /i "../../srclib/apr/include" /i "../../build\win32" /d "_DEBUG" /d BIN_NAME="mod_socache_memcache.so" /d LONG_NAME="socache_memcache_module for Apache" $(SOURCE)
!ENDIF
SOURCE=.\mod_socache_memcache.c
"$(INTDIR)\mod_socache_memcache.obj" : $(SOURCE) "$(INTDIR)"
!ENDIF

486
modules/cache/mod_socache_redis.c vendored Normal file
View file

@ -0,0 +1,486 @@
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "httpd.h"
#include "http_config.h"
#include "http_protocol.h"
#include "apr.h"
#include "apu_version.h"
#include "ap_socache.h"
#include "ap_mpm.h"
#include "http_log.h"
#include "apr_strings.h"
#include "mod_status.h"
typedef struct {
apr_uint32_t ttl;
apr_uint32_t rwto;
} socache_rd_svr_cfg;
/* apr_redis support requires >= 1.6 */
#if APU_MAJOR_VERSION > 1 || \
(APU_MAJOR_VERSION == 1 && APU_MINOR_VERSION > 5)
#define HAVE_APU_REDIS 1
#endif
/* The underlying apr_redis system is thread safe.. */
#define RD_KEY_LEN 254
#ifndef RD_DEFAULT_SERVER_PORT
#define RD_DEFAULT_SERVER_PORT 6379
#endif
#ifndef RD_DEFAULT_SERVER_MIN
#define RD_DEFAULT_SERVER_MIN 0
#endif
#ifndef RD_DEFAULT_SERVER_SMAX
#define RD_DEFAULT_SERVER_SMAX 1
#endif
#ifndef RD_DEFAULT_SERVER_TTL
#define RD_DEFAULT_SERVER_TTL apr_time_from_sec(15)
#endif
#ifndef RD_DEFAULT_SERVER_RWTO
#define RD_DEFAULT_SERVER_RWTO apr_time_from_sec(5)
#endif
module AP_MODULE_DECLARE_DATA socache_redis_module;
#ifdef HAVE_APU_REDIS
#include "apr_redis.h"
struct ap_socache_instance_t {
const char *servers;
apr_redis_t *rc;
const char *tag;
apr_size_t taglen; /* strlen(tag) + 1 */
};
static const char *socache_rd_create(ap_socache_instance_t **context,
const char *arg,
apr_pool_t *tmp, apr_pool_t *p)
{
ap_socache_instance_t *ctx;
*context = ctx = apr_pcalloc(p, sizeof *ctx);
if (!arg || !*arg) {
return "List of server names required to create redis socache.";
}
ctx->servers = apr_pstrdup(p, arg);
return NULL;
}
static apr_status_t socache_rd_init(ap_socache_instance_t *ctx,
const char *namespace,
const struct ap_socache_hints *hints,
server_rec *s, apr_pool_t *p)
{
apr_status_t rv;
int thread_limit = 0;
apr_uint16_t nservers = 0;
char *cache_config;
char *split;
char *tok;
socache_rd_svr_cfg *sconf = ap_get_module_config(s->module_config,
&socache_redis_module);
ap_mpm_query(AP_MPMQ_HARD_LIMIT_THREADS, &thread_limit);
/* Find all the servers in the first run to get a total count */
cache_config = apr_pstrdup(p, ctx->servers);
split = apr_strtok(cache_config, ",", &tok);
while (split) {
nservers++;
split = apr_strtok(NULL,",", &tok);
}
rv = apr_redis_create(p, nservers, 0, &ctx->rc);
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s, APLOGNO(03473)
"Failed to create Redis Object of '%d' size.",
nservers);
return rv;
}
/* Now add each server to the redis */
cache_config = apr_pstrdup(p, ctx->servers);
split = apr_strtok(cache_config, ",", &tok);
while (split) {
apr_redis_server_t *st;
char *host_str;
char *scope_id;
apr_port_t port;
rv = apr_parse_addr_port(&host_str, &scope_id, &port, split, p);
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s, APLOGNO(03474)
"Failed to Parse redis Server: '%s'", split);
return rv;
}
if (host_str == NULL) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s, APLOGNO(03475)
"Failed to Parse Server, "
"no hostname specified: '%s'", split);
return APR_EINVAL;
}
if (port == 0) {
port = RD_DEFAULT_SERVER_PORT;
}
rv = apr_redis_server_create(p,
host_str, port,
RD_DEFAULT_SERVER_MIN,
RD_DEFAULT_SERVER_SMAX,
thread_limit,
sconf->ttl,
sconf->rwto,
&st);
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s, APLOGNO(03476)
"Failed to Create redis Server: %s:%d",
host_str, port);
return rv;
}
rv = apr_redis_add_server(ctx->rc, st);
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s, APLOGNO(03477)
"Failed to Add redis Server: %s:%d",
host_str, port);
return rv;
}
split = apr_strtok(NULL,",", &tok);
}
ctx->tag = apr_pstrcat(p, namespace, ":", NULL);
ctx->taglen = strlen(ctx->tag) + 1;
/* socache API constraint: */
AP_DEBUG_ASSERT(ctx->taglen <= 16);
return APR_SUCCESS;
}
static void socache_rd_destroy(ap_socache_instance_t *context, server_rec *s)
{
/* noop. */
}
/* Converts (binary) id into a key prefixed by the predetermined
* namespace tag; writes output to key buffer. Returns non-zero if
* the id won't fit in the key buffer. */
static int socache_rd_id2key(ap_socache_instance_t *ctx,
const unsigned char *id, unsigned int idlen,
char *key, apr_size_t keylen)
{
char *cp;
if (idlen * 2 + ctx->taglen >= keylen)
return 1;
cp = apr_cpystrn(key, ctx->tag, ctx->taglen);
ap_bin2hex(id, idlen, cp);
return 0;
}
static apr_status_t socache_rd_store(ap_socache_instance_t *ctx, server_rec *s,
const unsigned char *id, unsigned int idlen,
apr_time_t expiry,
unsigned char *ucaData, unsigned int nData,
apr_pool_t *p)
{
char buf[RD_KEY_LEN];
apr_status_t rv;
apr_uint32_t timeout;
if (socache_rd_id2key(ctx, id, idlen, buf, sizeof(buf))) {
return APR_EINVAL;
}
timeout = apr_time_sec(expiry - apr_time_now());
if (timeout <= 0) {
return APR_EINVAL;
}
rv = apr_redis_setex(ctx->rc, buf, (char*)ucaData, nData, timeout, 0);
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s, APLOGNO(03478)
"scache_rd: error setting key '%s' "
"with %d bytes of data", buf, nData);
return rv;
}
return APR_SUCCESS;
}
static apr_status_t socache_rd_retrieve(ap_socache_instance_t *ctx, server_rec *s,
const unsigned char *id, unsigned int idlen,
unsigned char *dest, unsigned int *destlen,
apr_pool_t *p)
{
apr_size_t data_len;
char buf[RD_KEY_LEN], *data;
apr_status_t rv;
if (socache_rd_id2key(ctx, id, idlen, buf, sizeof buf)) {
return APR_EINVAL;
}
/* ### this could do with a subpool, but _getp looks like it will
* eat memory like it's going out of fashion anyway. */
rv = apr_redis_getp(ctx->rc, p, buf, &data, &data_len, NULL);
if (rv) {
if (rv != APR_NOTFOUND) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(03479)
"scache_rd: 'retrieve' FAIL");
}
return rv;
}
else if (data_len > *destlen) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(03480)
"scache_rd: 'retrieve' OVERFLOW");
return APR_ENOMEM;
}
memcpy(dest, data, data_len);
*destlen = data_len;
return APR_SUCCESS;
}
static apr_status_t socache_rd_remove(ap_socache_instance_t *ctx, server_rec *s,
const unsigned char *id,
unsigned int idlen, apr_pool_t *p)
{
char buf[RD_KEY_LEN];
apr_status_t rv;
if (socache_rd_id2key(ctx, id, idlen, buf, sizeof buf)) {
return APR_EINVAL;
}
rv = apr_redis_delete(ctx->rc, buf, 0);
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, s, APLOGNO(03481)
"scache_rd: error deleting key '%s' ",
buf);
}
return rv;
}
static void socache_rd_status(ap_socache_instance_t *ctx, request_rec *r, int flags)
{
apr_redis_t *rc = ctx->rc;
int i;
for (i = 0; i < rc->ntotal; i++) {
apr_redis_server_t *rs;
apr_redis_stats_t *stats;
char *role;
apr_status_t rv;
char *br = (!(flags & AP_STATUS_SHORT) ? "<br />" : "");
rs = rc->live_servers[i];
ap_rprintf(r, "Redis server: %s:%d [%s]%s\n", rs->host, (int)rs->port,
(rs->status == APR_RC_SERVER_LIVE) ? "Up" : "Down",
br);
rv = apr_redis_stats(rs, r->pool, &stats);
if (rv != APR_SUCCESS)
continue;
if (!(flags & AP_STATUS_SHORT)) {
ap_rprintf(r, "<b>General::</b> Version: <i>%u.%u.%u</i> [%u bits], PID: <i>%u</i>, Uptime: <i>%u hrs</i> <br />\n",
stats->major, stats->minor, stats->patch, stats->arch_bits,
stats->process_id, stats->uptime_in_seconds/3600);
ap_rprintf(r, "<b>Clients::</b> Connected: <i>%d</i>, Blocked: <i>%d</i> <br />\n",
stats->connected_clients, stats->blocked_clients);
ap_rprintf(r, "<b>Memory::</b> Total: <i>%" APR_UINT64_T_FMT "</i>, Max: <i>%" APR_UINT64_T_FMT "</i>, Used: <i>%" APR_UINT64_T_FMT "</i> <br />\n",
stats->total_system_memory, stats->maxmemory, stats->used_memory);
ap_rprintf(r, "<b>CPU::</b> System: <i>%u</i>, User: <i>%u</i><br />\n",
stats->used_cpu_sys, stats->used_cpu_user );
ap_rprintf(r, "<b>Connections::</b> Recd: <i>%" APR_UINT64_T_FMT "</i>, Processed: <i>%" APR_UINT64_T_FMT "</i>, Rejected: <i>%" APR_UINT64_T_FMT "</i> <br />\n",
stats->total_connections_received, stats->total_commands_processed,
stats->rejected_connections);
ap_rprintf(r, "<b>Cache::</b> Hits: <i>%" APR_UINT64_T_FMT "</i>, Misses: <i>%" APR_UINT64_T_FMT "</i> <br />\n",
stats->keyspace_hits, stats->keyspace_misses);
ap_rprintf(r, "<b>Net::</b> Input bytes: <i>%" APR_UINT64_T_FMT "</i>, Output bytes: <i>%" APR_UINT64_T_FMT "</i> <br />\n",
stats->total_net_input_bytes, stats->total_net_output_bytes);
if (stats->role == APR_RS_SERVER_MASTER)
role = "master";
else if (stats->role == APR_RS_SERVER_SLAVE)
role = "slave";
else
role = "unknown";
ap_rprintf(r, "<b>Misc::</b> Role: <i>%s</i>, Connected Slaves: <i>%u</i>, Is Cluster?: <i>%s</i> \n",
role, stats->connected_clients,
(stats->cluster_enabled ? "yes" : "no"));
ap_rputs("<hr><br />\n", r);
}
else {
ap_rprintf(r, "Version: %u.%u.%u [%u bits], PID: %u, Uptime: %u hrs %s\n",
stats->major, stats->minor, stats->patch, stats->arch_bits,
stats->process_id, stats->uptime_in_seconds/3600, br);
ap_rprintf(r, "Clients:: Connected: %d, Blocked: %d %s\n",
stats->connected_clients, stats->blocked_clients, br);
ap_rprintf(r, "Memory:: Total: %" APR_UINT64_T_FMT ", Max: %" APR_UINT64_T_FMT ", Used: %" APR_UINT64_T_FMT " %s\n",
stats->total_system_memory, stats->maxmemory, stats->used_memory,
br);
ap_rprintf(r, "CPU:: System: %u, User: %u %s\n",
stats->used_cpu_sys, stats->used_cpu_user , br);
ap_rprintf(r, "Connections:: Recd: %" APR_UINT64_T_FMT ", Processed: %" APR_UINT64_T_FMT ", Rejected: %" APR_UINT64_T_FMT " %s\n",
stats->total_connections_received, stats->total_commands_processed,
stats->rejected_connections, br);
ap_rprintf(r, "Cache:: Hits: %" APR_UINT64_T_FMT ", Misses: %" APR_UINT64_T_FMT " %s\n",
stats->keyspace_hits, stats->keyspace_misses, br);
ap_rprintf(r, "Net:: Input bytes: %" APR_UINT64_T_FMT ", Output bytes: %" APR_UINT64_T_FMT " %s\n",
stats->total_net_input_bytes, stats->total_net_output_bytes, br);
if (stats->role == APR_RS_SERVER_MASTER)
role = "master";
else if (stats->role == APR_RS_SERVER_SLAVE)
role = "slave";
else
role = "unknown";
ap_rprintf(r, "Misc:: Role: %s, Connected Slaves: %u, Is Cluster?: %s %s\n",
role, stats->connected_clients,
(stats->cluster_enabled ? "yes" : "no"), br);
}
}
}
static apr_status_t socache_rd_iterate(ap_socache_instance_t *instance,
server_rec *s, void *userctx,
ap_socache_iterator_t *iterator,
apr_pool_t *pool)
{
return APR_ENOTIMPL;
}
static const ap_socache_provider_t socache_mc = {
"redis",
0,
socache_rd_create,
socache_rd_init,
socache_rd_destroy,
socache_rd_store,
socache_rd_retrieve,
socache_rd_remove,
socache_rd_status,
socache_rd_iterate,
};
#endif /* HAVE_APU_REDIS */
static void* create_server_config(apr_pool_t* p, server_rec* s)
{
socache_rd_svr_cfg *sconf = apr_palloc(p, sizeof(socache_rd_svr_cfg));
sconf->ttl = RD_DEFAULT_SERVER_TTL;
sconf->rwto = RD_DEFAULT_SERVER_RWTO;
return sconf;
}
static const char *socache_rd_set_ttl(cmd_parms *cmd, void *dummy,
const char *arg)
{
apr_interval_time_t ttl;
socache_rd_svr_cfg *sconf = ap_get_module_config(cmd->server->module_config,
&socache_redis_module);
if (ap_timeout_parameter_parse(arg, &ttl, "s") != APR_SUCCESS) {
return apr_pstrcat(cmd->pool, cmd->cmd->name,
" has wrong format", NULL);
}
if ((ttl < apr_time_from_sec(0)) || (ttl > apr_time_from_sec(3600))) {
return apr_pstrcat(cmd->pool, cmd->cmd->name,
" can only be 0 or up to one hour.", NULL);
}
/* apr_redis_server_create needs a ttl in usec. */
sconf->ttl = ttl;
return NULL;
}
static const char *socache_rd_set_rwto(cmd_parms *cmd, void *dummy,
const char *arg)
{
apr_interval_time_t rwto;
socache_rd_svr_cfg *sconf = ap_get_module_config(cmd->server->module_config,
&socache_redis_module);
if (ap_timeout_parameter_parse(arg, &rwto, "s") != APR_SUCCESS) {
return apr_pstrcat(cmd->pool, cmd->cmd->name,
" has wrong format", NULL);
}
if ((rwto < apr_time_from_sec(0)) || (rwto > apr_time_from_sec(3600))) {
return apr_pstrcat(cmd->pool, cmd->cmd->name,
" can only be 0 or up to one hour.", NULL);
}
/* apr_redis_server_create needs a ttl in usec. */
sconf->rwto = rwto;
return NULL;
}
static void register_hooks(apr_pool_t *p)
{
#ifdef HAVE_APU_REDIS
ap_register_provider(p, AP_SOCACHE_PROVIDER_GROUP, "redis",
AP_SOCACHE_PROVIDER_VERSION,
&socache_mc);
#endif
}
static const command_rec socache_redis_cmds[] =
{
AP_INIT_TAKE1("RedisConnPoolTTL", socache_rd_set_ttl, NULL, RSRC_CONF,
"TTL used for the connection pool with the Redis server(s)"),
AP_INIT_TAKE1("RedisTimeout", socache_rd_set_rwto, NULL, RSRC_CONF,
"R/W timeout used for the connection with the Redis server(s)"),
{NULL}
};
AP_DECLARE_MODULE(socache_redis) = {
STANDARD20_MODULE_STUFF,
NULL, /* create per-dir config structures */
NULL, /* merge per-dir config structures */
create_server_config, /* create per-server config structures */
NULL, /* merge per-server config structures */
socache_redis_cmds, /* table of config file commands */
register_hooks /* register hooks */
};

5
modules/cache/mod_socache_redis.dep vendored Normal file
View file

@ -0,0 +1,5 @@
# Microsoft Developer Studio Generated Dependency File, included by mod_socache_shmcb.mak
..\..\build\win32\httpd.rc : \
"..\..\include\ap_release.h"\

111
modules/cache/mod_socache_redis.dsp vendored Normal file
View file

@ -0,0 +1,111 @@
# Microsoft Developer Studio Project File - Name="mod_socache_redis" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=mod_socache_redis - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "mod_socache_redis.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "mod_socache_redis.mak" CFG="mod_socache_redis - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "mod_socache_redis - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "mod_socache_redis - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "mod_socache_redis - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../generators" /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "AAA_DECLARE_EXPORT" /Fd"Release\mod_socache_redis_src" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL"
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL"
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /fo"Release/mod_socache_redis.res" /i "../../include" /i "../../srclib/apr/include" /d "NDEBUG" /d BIN_NAME="mod_socache_redis.so" /d LONG_NAME="socache_redis module for Apache"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_socache_redis.so" /base:@..\..\os\win32\BaseAddr.ref,mod_socache_redis.so
# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_socache_redis.so" /base:@..\..\os\win32\BaseAddr.ref,mod_socache_redis.so /opt:ref
# Begin Special Build Tool
TargetPath=.\Release\mod_socache_redis.so
SOURCE="$(InputPath)"
PostBuild_Desc=Embed .manifest
PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2
# End Special Build Tool
!ELSEIF "$(CFG)" == "mod_socache_redis - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c
# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../generators" /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "AAA_DECLARE_EXPORT" /Fd"Debug\mod_socache_redis_src" /FD /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL"
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL"
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /fo"Debug/mod_socache_redis.res" /i "../../include" /i "../../srclib/apr/include" /d "_DEBUG" /d BIN_NAME="mod_socache_redis.so" /d LONG_NAME="socache_redis module for Apache"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_socache_redis.so" /base:@..\..\os\win32\BaseAddr.ref,mod_socache_redis.so
# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_socache_redis.so" /base:@..\..\os\win32\BaseAddr.ref,mod_socache_redis.so
# Begin Special Build Tool
TargetPath=.\Debug\mod_socache_redis.so
SOURCE="$(InputPath)"
PostBuild_Desc=Embed .manifest
PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2
# End Special Build Tool
!ENDIF
# Begin Target
# Name "mod_socache_redis - Win32 Release"
# Name "mod_socache_redis - Win32 Debug"
# Begin Source File
SOURCE=.\mod_socache_redis.c
# End Source File
# Begin Source File
SOURCE=..\..\build\win32\httpd.rc
# End Source File
# End Target
# End Project

353
modules/cache/mod_socache_redis.mak vendored Normal file
View file

@ -0,0 +1,353 @@
# Microsoft Developer Studio Generated NMAKE File, Based on mod_socache_redis.dsp
!IF "$(CFG)" == ""
CFG=mod_socache_redis - Win32 Debug
!MESSAGE No configuration specified. Defaulting to mod_socache_redis - Win32 Debug.
!ENDIF
!IF "$(CFG)" != "mod_socache_redis - Win32 Release" && "$(CFG)" != "mod_socache_redis - Win32 Debug"
!MESSAGE Invalid configuration "$(CFG)" specified.
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "mod_socache_redis.mak" CFG="mod_socache_redis - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "mod_socache_redis - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "mod_socache_redis - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
!ERROR An invalid configuration is specified.
!ENDIF
!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF
!IF "$(CFG)" == "mod_socache_redis - Win32 Release"
OUTDIR=.\Release
INTDIR=.\Release
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
# Begin Custom Macros
OutDir=.\Release
# End Custom Macros
!IF "$(RECURSE)" == "0"
ALL : "$(OUTDIR)\mod_socache_redis.so" "$(DS_POSTBUILD_DEP)"
!ELSE
ALL : "libhttpd - Win32 Release" "libaprutil - Win32 Release" "libapr - Win32 Release" "$(OUTDIR)\mod_socache_redis.so" "$(DS_POSTBUILD_DEP)"
!ENDIF
!IF "$(RECURSE)" == "1"
CLEAN :"libapr - Win32 ReleaseCLEAN" "libaprutil - Win32 ReleaseCLEAN" "libhttpd - Win32 ReleaseCLEAN"
!ELSE
CLEAN :
!ENDIF
-@erase "$(INTDIR)\mod_socache_redis.obj"
-@erase "$(INTDIR)\mod_socache_redis.res"
-@erase "$(INTDIR)\mod_socache_redis_src.idb"
-@erase "$(INTDIR)\mod_socache_redis_src.pdb"
-@erase "$(OUTDIR)\mod_socache_redis.exp"
-@erase "$(OUTDIR)\mod_socache_redis.lib"
-@erase "$(OUTDIR)\mod_socache_redis.pdb"
-@erase "$(OUTDIR)\mod_socache_redis.so"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP=cl.exe
CPP_PROJ=/nologo /MD /W3 /Zi /O2 /Oy- /I "../../srclib/apr-util/include" /I "../../srclib/apr/include" /I "../../include" /I "../generators" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\mod_socache_redis_src" /FD /c
.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
MTL=midl.exe
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
RSC=rc.exe
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\mod_socache_redis.res" /i "../../include" /i "../../srclib/apr/include" /d "NDEBUG" /d BIN_NAME="mod_socache_redis.so" /d LONG_NAME="socache_redis_module for Apache"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\mod_socache_redis.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=kernel32.lib /nologo /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\mod_socache_redis.pdb" /debug /out:"$(OUTDIR)\mod_socache_redis.so" /implib:"$(OUTDIR)\mod_socache_redis.lib" /base:@..\..\os\win32\BaseAddr.ref,mod_socache_redis.so /opt:ref
LINK32_OBJS= \
"$(INTDIR)\mod_socache_redis.obj" \
"$(INTDIR)\mod_socache_redis.res" \
"..\..\srclib\apr\Release\libapr-1.lib" \
"..\..\srclib\apr-util\Release\libaprutil-1.lib" \
"..\..\Release\libhttpd.lib"
"$(OUTDIR)\mod_socache_redis.so" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
TargetPath=.\Release\mod_socache_redis.so
SOURCE="$(InputPath)"
PostBuild_Desc=Embed .manifest
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
# Begin Custom Macros
OutDir=.\Release
# End Custom Macros
"$(DS_POSTBUILD_DEP)" : "$(OUTDIR)\mod_socache_redis.so"
if exist .\Release\mod_socache_redis.so.manifest mt.exe -manifest .\Release\mod_socache_redis.so.manifest -outputresource:.\Release\mod_socache_redis.so;2
echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)"
!ELSEIF "$(CFG)" == "mod_socache_redis - Win32 Debug"
OUTDIR=.\Debug
INTDIR=.\Debug
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
# Begin Custom Macros
OutDir=.\Debug
# End Custom Macros
!IF "$(RECURSE)" == "0"
ALL : "$(OUTDIR)\mod_socache_redis.so" "$(DS_POSTBUILD_DEP)"
!ELSE
ALL : "libhttpd - Win32 Debug" "libaprutil - Win32 Debug" "libapr - Win32 Debug" "$(OUTDIR)\mod_socache_redis.so" "$(DS_POSTBUILD_DEP)"
!ENDIF
!IF "$(RECURSE)" == "1"
CLEAN :"libapr - Win32 DebugCLEAN" "libaprutil - Win32 DebugCLEAN" "libhttpd - Win32 DebugCLEAN"
!ELSE
CLEAN :
!ENDIF
-@erase "$(INTDIR)\mod_socache_redis.obj"
-@erase "$(INTDIR)\mod_socache_redis.res"
-@erase "$(INTDIR)\mod_socache_redis_src.idb"
-@erase "$(INTDIR)\mod_socache_redis_src.pdb"
-@erase "$(OUTDIR)\mod_socache_redis.exp"
-@erase "$(OUTDIR)\mod_socache_redis.lib"
-@erase "$(OUTDIR)\mod_socache_redis.pdb"
-@erase "$(OUTDIR)\mod_socache_redis.so"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP=cl.exe
CPP_PROJ=/nologo /MDd /W3 /Zi /Od /I "../../srclib/apr-util/include" /I "../../srclib/apr/include" /I "../../include" /I "../generators" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\mod_socache_redis_src" /FD /EHsc /c
.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
MTL=midl.exe
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
RSC=rc.exe
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\mod_socache_redis.res" /i "../../include" /i "../../srclib/apr/include" /d "_DEBUG" /d BIN_NAME="mod_socache_redis.so" /d LONG_NAME="socache_redis_module for Apache"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\mod_socache_redis.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=kernel32.lib /nologo /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\mod_socache_redis.pdb" /debug /out:"$(OUTDIR)\mod_socache_redis.so" /implib:"$(OUTDIR)\mod_socache_redis.lib" /base:@..\..\os\win32\BaseAddr.ref,mod_socache_redis.so
LINK32_OBJS= \
"$(INTDIR)\mod_socache_redis.obj" \
"$(INTDIR)\mod_socache_redis.res" \
"..\..\srclib\apr\Debug\libapr-1.lib" \
"..\..\srclib\apr-util\Debug\libaprutil-1.lib" \
"..\..\Debug\libhttpd.lib"
"$(OUTDIR)\mod_socache_redis.so" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
TargetPath=.\Debug\mod_socache_redis.so
SOURCE="$(InputPath)"
PostBuild_Desc=Embed .manifest
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
# Begin Custom Macros
OutDir=.\Debug
# End Custom Macros
"$(DS_POSTBUILD_DEP)" : "$(OUTDIR)\mod_socache_redis.so"
if exist .\Debug\mod_socache_redis.so.manifest mt.exe -manifest .\Debug\mod_socache_redis.so.manifest -outputresource:.\Debug\mod_socache_redis.so;2
echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)"
!ENDIF
!IF "$(NO_EXTERNAL_DEPS)" != "1"
!IF EXISTS("mod_socache_redis.dep")
!INCLUDE "mod_socache_redis.dep"
!ELSE
!MESSAGE Warning: cannot find "mod_socache_redis.dep"
!ENDIF
!ENDIF
!IF "$(CFG)" == "mod_socache_redis - Win32 Release" || "$(CFG)" == "mod_socache_redis - Win32 Debug"
!IF "$(CFG)" == "mod_socache_redis - Win32 Release"
"libapr - Win32 Release" :
cd ".\..\..\srclib\apr"
$(MAKE) /$(MAKEFLAGS) /F ".\libapr.mak" CFG="libapr - Win32 Release"
cd "..\..\modules\cache"
"libapr - Win32 ReleaseCLEAN" :
cd ".\..\..\srclib\apr"
$(MAKE) /$(MAKEFLAGS) /F ".\libapr.mak" CFG="libapr - Win32 Release" RECURSE=1 CLEAN
cd "..\..\modules\cache"
!ELSEIF "$(CFG)" == "mod_socache_redis - Win32 Debug"
"libapr - Win32 Debug" :
cd ".\..\..\srclib\apr"
$(MAKE) /$(MAKEFLAGS) /F ".\libapr.mak" CFG="libapr - Win32 Debug"
cd "..\..\modules\cache"
"libapr - Win32 DebugCLEAN" :
cd ".\..\..\srclib\apr"
$(MAKE) /$(MAKEFLAGS) /F ".\libapr.mak" CFG="libapr - Win32 Debug" RECURSE=1 CLEAN
cd "..\..\modules\cache"
!ENDIF
!IF "$(CFG)" == "mod_socache_redis - Win32 Release"
"libaprutil - Win32 Release" :
cd ".\..\..\srclib\apr-util"
$(MAKE) /$(MAKEFLAGS) /F ".\libaprutil.mak" CFG="libaprutil - Win32 Release"
cd "..\..\modules\cache"
"libaprutil - Win32 ReleaseCLEAN" :
cd ".\..\..\srclib\apr-util"
$(MAKE) /$(MAKEFLAGS) /F ".\libaprutil.mak" CFG="libaprutil - Win32 Release" RECURSE=1 CLEAN
cd "..\..\modules\cache"
!ELSEIF "$(CFG)" == "mod_socache_redis - Win32 Debug"
"libaprutil - Win32 Debug" :
cd ".\..\..\srclib\apr-util"
$(MAKE) /$(MAKEFLAGS) /F ".\libaprutil.mak" CFG="libaprutil - Win32 Debug"
cd "..\..\modules\cache"
"libaprutil - Win32 DebugCLEAN" :
cd ".\..\..\srclib\apr-util"
$(MAKE) /$(MAKEFLAGS) /F ".\libaprutil.mak" CFG="libaprutil - Win32 Debug" RECURSE=1 CLEAN
cd "..\..\modules\cache"
!ENDIF
!IF "$(CFG)" == "mod_socache_redis - Win32 Release"
"libhttpd - Win32 Release" :
cd ".\..\.."
$(MAKE) /$(MAKEFLAGS) /F ".\libhttpd.mak" CFG="libhttpd - Win32 Release"
cd ".\modules\cache"
"libhttpd - Win32 ReleaseCLEAN" :
cd ".\..\.."
$(MAKE) /$(MAKEFLAGS) /F ".\libhttpd.mak" CFG="libhttpd - Win32 Release" RECURSE=1 CLEAN
cd ".\modules\cache"
!ELSEIF "$(CFG)" == "mod_socache_redis - Win32 Debug"
"libhttpd - Win32 Debug" :
cd ".\..\.."
$(MAKE) /$(MAKEFLAGS) /F ".\libhttpd.mak" CFG="libhttpd - Win32 Debug"
cd ".\modules\cache"
"libhttpd - Win32 DebugCLEAN" :
cd ".\..\.."
$(MAKE) /$(MAKEFLAGS) /F ".\libhttpd.mak" CFG="libhttpd - Win32 Debug" RECURSE=1 CLEAN
cd ".\modules\cache"
!ENDIF
SOURCE=..\..\build\win32\httpd.rc
!IF "$(CFG)" == "mod_socache_redis - Win32 Release"
"$(INTDIR)\mod_socache_redis.res" : $(SOURCE) "$(INTDIR)"
$(RSC) /l 0x409 /fo"$(INTDIR)\mod_socache_redis.res" /i "../../include" /i "../../srclib/apr/include" /i "../../build\win32" /d "NDEBUG" /d BIN_NAME="mod_socache_redis.so" /d LONG_NAME="socache_redis_module for Apache" $(SOURCE)
!ELSEIF "$(CFG)" == "mod_socache_redis - Win32 Debug"
"$(INTDIR)\mod_socache_redis.res" : $(SOURCE) "$(INTDIR)"
$(RSC) /l 0x409 /fo"$(INTDIR)\mod_socache_redis.res" /i "../../include" /i "../../srclib/apr/include" /i "../../build\win32" /d "_DEBUG" /d BIN_NAME="mod_socache_redis.so" /d LONG_NAME="socache_redis_module for Apache" $(SOURCE)
!ENDIF
SOURCE=.\mod_socache_redis.c
"$(INTDIR)\mod_socache_redis.obj" : $(SOURCE) "$(INTDIR)"
!ENDIF

1085
modules/cache/mod_socache_shmcb.c vendored Normal file

File diff suppressed because it is too large Load diff

56
modules/cache/mod_socache_shmcb.dep vendored Normal file
View file

@ -0,0 +1,56 @@
# Microsoft Developer Studio Generated Dependency File, included by mod_socache_shmcb.mak
..\..\build\win32\httpd.rc : \
"..\..\include\ap_release.h"\
.\mod_socache_shmcb.c : \
"..\..\include\ap_config.h"\
"..\..\include\ap_config_layout.h"\
"..\..\include\ap_hooks.h"\
"..\..\include\ap_mmn.h"\
"..\..\include\ap_provider.h"\
"..\..\include\ap_regex.h"\
"..\..\include\ap_release.h"\
"..\..\include\ap_socache.h"\
"..\..\include\apache_noprobes.h"\
"..\..\include\http_config.h"\
"..\..\include\http_log.h"\
"..\..\include\http_protocol.h"\
"..\..\include\http_request.h"\
"..\..\include\httpd.h"\
"..\..\include\os.h"\
"..\..\include\util_cfgtree.h"\
"..\..\include\util_filter.h"\
"..\..\srclib\apr-util\include\apr_buckets.h"\
"..\..\srclib\apr-util\include\apr_hooks.h"\
"..\..\srclib\apr-util\include\apr_optional.h"\
"..\..\srclib\apr-util\include\apr_optional_hooks.h"\
"..\..\srclib\apr-util\include\apr_uri.h"\
"..\..\srclib\apr-util\include\apu.h"\
"..\..\srclib\apr\include\apr.h"\
"..\..\srclib\apr\include\apr_allocator.h"\
"..\..\srclib\apr\include\apr_dso.h"\
"..\..\srclib\apr\include\apr_errno.h"\
"..\..\srclib\apr\include\apr_file_info.h"\
"..\..\srclib\apr\include\apr_file_io.h"\
"..\..\srclib\apr\include\apr_general.h"\
"..\..\srclib\apr\include\apr_global_mutex.h"\
"..\..\srclib\apr\include\apr_inherit.h"\
"..\..\srclib\apr\include\apr_mmap.h"\
"..\..\srclib\apr\include\apr_network_io.h"\
"..\..\srclib\apr\include\apr_poll.h"\
"..\..\srclib\apr\include\apr_pools.h"\
"..\..\srclib\apr\include\apr_portable.h"\
"..\..\srclib\apr\include\apr_proc_mutex.h"\
"..\..\srclib\apr\include\apr_ring.h"\
"..\..\srclib\apr\include\apr_shm.h"\
"..\..\srclib\apr\include\apr_strings.h"\
"..\..\srclib\apr\include\apr_tables.h"\
"..\..\srclib\apr\include\apr_thread_mutex.h"\
"..\..\srclib\apr\include\apr_thread_proc.h"\
"..\..\srclib\apr\include\apr_time.h"\
"..\..\srclib\apr\include\apr_user.h"\
"..\..\srclib\apr\include\apr_want.h"\
"..\generators\mod_status.h"\

111
modules/cache/mod_socache_shmcb.dsp vendored Normal file
View file

@ -0,0 +1,111 @@
# Microsoft Developer Studio Project File - Name="mod_socache_shmcb" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=mod_socache_shmcb - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "mod_socache_shmcb.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "mod_socache_shmcb.mak" CFG="mod_socache_shmcb - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "mod_socache_shmcb - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "mod_socache_shmcb - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "mod_socache_shmcb - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "mod_socache_shmcb_EXPORTS" /FD /c
# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../../srclib/apr-util/include" /I "../../srclib/apr/include" /I "../../include" /I "../generators" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Release\mod_socache_shmcb_src" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /fo"Release/mod_socache_shmcb.res" /i "../../include" /i "../../srclib/apr/include" /d "NDEBUG" /d BIN_NAME="mod_socache_shmcb.so" /d LONG_NAME="socache_shmcb_module for Apache"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll
# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_socache_shmcb.so" /base:@..\..\os\win32\BaseAddr.ref,mod_socache_shmcb.so /opt:ref
# Begin Special Build Tool
TargetPath=.\Release\mod_socache_shmcb.so
SOURCE="$(InputPath)"
PostBuild_Desc=Embed .manifest
PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2
# End Special Build Tool
!ELSEIF "$(CFG)" == "mod_socache_shmcb - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c
# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../../srclib/apr-util/include" /I "../../srclib/apr/include" /I "../../include" /I "../generators" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Debug\mod_socache_shmcb_src" /FD /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /fo"Debug/mod_socache_shmcb.res" /i "../../include" /i "../../srclib/apr/include" /d "_DEBUG" /d BIN_NAME="mod_socache_shmcb.so" /d LONG_NAME="socache_shmcb_module for Apache"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug
# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_socache_shmcb.so" /base:@..\..\os\win32\BaseAddr.ref,mod_socache_shmcb.so
# Begin Special Build Tool
TargetPath=.\Debug\mod_socache_shmcb.so
SOURCE="$(InputPath)"
PostBuild_Desc=Embed .manifest
PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2
# End Special Build Tool
!ENDIF
# Begin Target
# Name "mod_socache_shmcb - Win32 Release"
# Name "mod_socache_shmcb - Win32 Debug"
# Begin Source File
SOURCE=.\mod_socache_shmcb.c
# End Source File
# Begin Source File
SOURCE=..\..\build\win32\httpd.rc
# End Source File
# End Target
# End Project

353
modules/cache/mod_socache_shmcb.mak vendored Normal file
View file

@ -0,0 +1,353 @@
# Microsoft Developer Studio Generated NMAKE File, Based on mod_socache_shmcb.dsp
!IF "$(CFG)" == ""
CFG=mod_socache_shmcb - Win32 Debug
!MESSAGE No configuration specified. Defaulting to mod_socache_shmcb - Win32 Debug.
!ENDIF
!IF "$(CFG)" != "mod_socache_shmcb - Win32 Release" && "$(CFG)" != "mod_socache_shmcb - Win32 Debug"
!MESSAGE Invalid configuration "$(CFG)" specified.
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "mod_socache_shmcb.mak" CFG="mod_socache_shmcb - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "mod_socache_shmcb - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "mod_socache_shmcb - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
!ERROR An invalid configuration is specified.
!ENDIF
!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF
!IF "$(CFG)" == "mod_socache_shmcb - Win32 Release"
OUTDIR=.\Release
INTDIR=.\Release
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
# Begin Custom Macros
OutDir=.\Release
# End Custom Macros
!IF "$(RECURSE)" == "0"
ALL : "$(OUTDIR)\mod_socache_shmcb.so" "$(DS_POSTBUILD_DEP)"
!ELSE
ALL : "libhttpd - Win32 Release" "libaprutil - Win32 Release" "libapr - Win32 Release" "$(OUTDIR)\mod_socache_shmcb.so" "$(DS_POSTBUILD_DEP)"
!ENDIF
!IF "$(RECURSE)" == "1"
CLEAN :"libapr - Win32 ReleaseCLEAN" "libaprutil - Win32 ReleaseCLEAN" "libhttpd - Win32 ReleaseCLEAN"
!ELSE
CLEAN :
!ENDIF
-@erase "$(INTDIR)\mod_socache_shmcb.obj"
-@erase "$(INTDIR)\mod_socache_shmcb.res"
-@erase "$(INTDIR)\mod_socache_shmcb_src.idb"
-@erase "$(INTDIR)\mod_socache_shmcb_src.pdb"
-@erase "$(OUTDIR)\mod_socache_shmcb.exp"
-@erase "$(OUTDIR)\mod_socache_shmcb.lib"
-@erase "$(OUTDIR)\mod_socache_shmcb.pdb"
-@erase "$(OUTDIR)\mod_socache_shmcb.so"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP=cl.exe
CPP_PROJ=/nologo /MD /W3 /Zi /O2 /Oy- /I "../../srclib/apr-util/include" /I "../../srclib/apr/include" /I "../../include" /I "../generators" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\mod_socache_shmcb_src" /FD /c
.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
MTL=midl.exe
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
RSC=rc.exe
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\mod_socache_shmcb.res" /i "../../include" /i "../../srclib/apr/include" /d "NDEBUG" /d BIN_NAME="mod_socache_shmcb.so" /d LONG_NAME="socache_shmcb_module for Apache"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\mod_socache_shmcb.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=kernel32.lib /nologo /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\mod_socache_shmcb.pdb" /debug /out:"$(OUTDIR)\mod_socache_shmcb.so" /implib:"$(OUTDIR)\mod_socache_shmcb.lib" /base:@..\..\os\win32\BaseAddr.ref,mod_socache_shmcb.so /opt:ref
LINK32_OBJS= \
"$(INTDIR)\mod_socache_shmcb.obj" \
"$(INTDIR)\mod_socache_shmcb.res" \
"..\..\srclib\apr\Release\libapr-1.lib" \
"..\..\srclib\apr-util\Release\libaprutil-1.lib" \
"..\..\Release\libhttpd.lib"
"$(OUTDIR)\mod_socache_shmcb.so" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
TargetPath=.\Release\mod_socache_shmcb.so
SOURCE="$(InputPath)"
PostBuild_Desc=Embed .manifest
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
# Begin Custom Macros
OutDir=.\Release
# End Custom Macros
"$(DS_POSTBUILD_DEP)" : "$(OUTDIR)\mod_socache_shmcb.so"
if exist .\Release\mod_socache_shmcb.so.manifest mt.exe -manifest .\Release\mod_socache_shmcb.so.manifest -outputresource:.\Release\mod_socache_shmcb.so;2
echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)"
!ELSEIF "$(CFG)" == "mod_socache_shmcb - Win32 Debug"
OUTDIR=.\Debug
INTDIR=.\Debug
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
# Begin Custom Macros
OutDir=.\Debug
# End Custom Macros
!IF "$(RECURSE)" == "0"
ALL : "$(OUTDIR)\mod_socache_shmcb.so" "$(DS_POSTBUILD_DEP)"
!ELSE
ALL : "libhttpd - Win32 Debug" "libaprutil - Win32 Debug" "libapr - Win32 Debug" "$(OUTDIR)\mod_socache_shmcb.so" "$(DS_POSTBUILD_DEP)"
!ENDIF
!IF "$(RECURSE)" == "1"
CLEAN :"libapr - Win32 DebugCLEAN" "libaprutil - Win32 DebugCLEAN" "libhttpd - Win32 DebugCLEAN"
!ELSE
CLEAN :
!ENDIF
-@erase "$(INTDIR)\mod_socache_shmcb.obj"
-@erase "$(INTDIR)\mod_socache_shmcb.res"
-@erase "$(INTDIR)\mod_socache_shmcb_src.idb"
-@erase "$(INTDIR)\mod_socache_shmcb_src.pdb"
-@erase "$(OUTDIR)\mod_socache_shmcb.exp"
-@erase "$(OUTDIR)\mod_socache_shmcb.lib"
-@erase "$(OUTDIR)\mod_socache_shmcb.pdb"
-@erase "$(OUTDIR)\mod_socache_shmcb.so"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP=cl.exe
CPP_PROJ=/nologo /MDd /W3 /Zi /Od /I "../../srclib/apr-util/include" /I "../../srclib/apr/include" /I "../../include" /I "../generators" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\mod_socache_shmcb_src" /FD /EHsc /c
.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
MTL=midl.exe
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
RSC=rc.exe
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\mod_socache_shmcb.res" /i "../../include" /i "../../srclib/apr/include" /d "_DEBUG" /d BIN_NAME="mod_socache_shmcb.so" /d LONG_NAME="socache_shmcb_module for Apache"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\mod_socache_shmcb.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=kernel32.lib /nologo /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\mod_socache_shmcb.pdb" /debug /out:"$(OUTDIR)\mod_socache_shmcb.so" /implib:"$(OUTDIR)\mod_socache_shmcb.lib" /base:@..\..\os\win32\BaseAddr.ref,mod_socache_shmcb.so
LINK32_OBJS= \
"$(INTDIR)\mod_socache_shmcb.obj" \
"$(INTDIR)\mod_socache_shmcb.res" \
"..\..\srclib\apr\Debug\libapr-1.lib" \
"..\..\srclib\apr-util\Debug\libaprutil-1.lib" \
"..\..\Debug\libhttpd.lib"
"$(OUTDIR)\mod_socache_shmcb.so" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
TargetPath=.\Debug\mod_socache_shmcb.so
SOURCE="$(InputPath)"
PostBuild_Desc=Embed .manifest
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
# Begin Custom Macros
OutDir=.\Debug
# End Custom Macros
"$(DS_POSTBUILD_DEP)" : "$(OUTDIR)\mod_socache_shmcb.so"
if exist .\Debug\mod_socache_shmcb.so.manifest mt.exe -manifest .\Debug\mod_socache_shmcb.so.manifest -outputresource:.\Debug\mod_socache_shmcb.so;2
echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)"
!ENDIF
!IF "$(NO_EXTERNAL_DEPS)" != "1"
!IF EXISTS("mod_socache_shmcb.dep")
!INCLUDE "mod_socache_shmcb.dep"
!ELSE
!MESSAGE Warning: cannot find "mod_socache_shmcb.dep"
!ENDIF
!ENDIF
!IF "$(CFG)" == "mod_socache_shmcb - Win32 Release" || "$(CFG)" == "mod_socache_shmcb - Win32 Debug"
!IF "$(CFG)" == "mod_socache_shmcb - Win32 Release"
"libapr - Win32 Release" :
cd ".\..\..\srclib\apr"
$(MAKE) /$(MAKEFLAGS) /F ".\libapr.mak" CFG="libapr - Win32 Release"
cd "..\..\modules\cache"
"libapr - Win32 ReleaseCLEAN" :
cd ".\..\..\srclib\apr"
$(MAKE) /$(MAKEFLAGS) /F ".\libapr.mak" CFG="libapr - Win32 Release" RECURSE=1 CLEAN
cd "..\..\modules\cache"
!ELSEIF "$(CFG)" == "mod_socache_shmcb - Win32 Debug"
"libapr - Win32 Debug" :
cd ".\..\..\srclib\apr"
$(MAKE) /$(MAKEFLAGS) /F ".\libapr.mak" CFG="libapr - Win32 Debug"
cd "..\..\modules\cache"
"libapr - Win32 DebugCLEAN" :
cd ".\..\..\srclib\apr"
$(MAKE) /$(MAKEFLAGS) /F ".\libapr.mak" CFG="libapr - Win32 Debug" RECURSE=1 CLEAN
cd "..\..\modules\cache"
!ENDIF
!IF "$(CFG)" == "mod_socache_shmcb - Win32 Release"
"libaprutil - Win32 Release" :
cd ".\..\..\srclib\apr-util"
$(MAKE) /$(MAKEFLAGS) /F ".\libaprutil.mak" CFG="libaprutil - Win32 Release"
cd "..\..\modules\cache"
"libaprutil - Win32 ReleaseCLEAN" :
cd ".\..\..\srclib\apr-util"
$(MAKE) /$(MAKEFLAGS) /F ".\libaprutil.mak" CFG="libaprutil - Win32 Release" RECURSE=1 CLEAN
cd "..\..\modules\cache"
!ELSEIF "$(CFG)" == "mod_socache_shmcb - Win32 Debug"
"libaprutil - Win32 Debug" :
cd ".\..\..\srclib\apr-util"
$(MAKE) /$(MAKEFLAGS) /F ".\libaprutil.mak" CFG="libaprutil - Win32 Debug"
cd "..\..\modules\cache"
"libaprutil - Win32 DebugCLEAN" :
cd ".\..\..\srclib\apr-util"
$(MAKE) /$(MAKEFLAGS) /F ".\libaprutil.mak" CFG="libaprutil - Win32 Debug" RECURSE=1 CLEAN
cd "..\..\modules\cache"
!ENDIF
!IF "$(CFG)" == "mod_socache_shmcb - Win32 Release"
"libhttpd - Win32 Release" :
cd ".\..\.."
$(MAKE) /$(MAKEFLAGS) /F ".\libhttpd.mak" CFG="libhttpd - Win32 Release"
cd ".\modules\cache"
"libhttpd - Win32 ReleaseCLEAN" :
cd ".\..\.."
$(MAKE) /$(MAKEFLAGS) /F ".\libhttpd.mak" CFG="libhttpd - Win32 Release" RECURSE=1 CLEAN
cd ".\modules\cache"
!ELSEIF "$(CFG)" == "mod_socache_shmcb - Win32 Debug"
"libhttpd - Win32 Debug" :
cd ".\..\.."
$(MAKE) /$(MAKEFLAGS) /F ".\libhttpd.mak" CFG="libhttpd - Win32 Debug"
cd ".\modules\cache"
"libhttpd - Win32 DebugCLEAN" :
cd ".\..\.."
$(MAKE) /$(MAKEFLAGS) /F ".\libhttpd.mak" CFG="libhttpd - Win32 Debug" RECURSE=1 CLEAN
cd ".\modules\cache"
!ENDIF
SOURCE=..\..\build\win32\httpd.rc
!IF "$(CFG)" == "mod_socache_shmcb - Win32 Release"
"$(INTDIR)\mod_socache_shmcb.res" : $(SOURCE) "$(INTDIR)"
$(RSC) /l 0x409 /fo"$(INTDIR)\mod_socache_shmcb.res" /i "../../include" /i "../../srclib/apr/include" /i "../../build\win32" /d "NDEBUG" /d BIN_NAME="mod_socache_shmcb.so" /d LONG_NAME="socache_shmcb_module for Apache" $(SOURCE)
!ELSEIF "$(CFG)" == "mod_socache_shmcb - Win32 Debug"
"$(INTDIR)\mod_socache_shmcb.res" : $(SOURCE) "$(INTDIR)"
$(RSC) /l 0x409 /fo"$(INTDIR)\mod_socache_shmcb.res" /i "../../include" /i "../../srclib/apr/include" /i "../../build\win32" /d "_DEBUG" /d BIN_NAME="mod_socache_shmcb.so" /d LONG_NAME="socache_shmcb_module for Apache" $(SOURCE)
!ENDIF
SOURCE=.\mod_socache_shmcb.c
"$(INTDIR)\mod_socache_shmcb.obj" : $(SOURCE) "$(INTDIR)"
!ENDIF