diff options
Diffstat (limited to 'modules')
183 files changed, 5152 insertions, 2032 deletions
diff --git a/modules/NWGNUmakefile b/modules/NWGNUmakefile index 1bcbf7db..b7bc80b1 100644 --- a/modules/NWGNUmakefile +++ b/modules/NWGNUmakefile @@ -37,19 +37,19 @@ endif #If the mod_edir directory exists then build the mod_edir module ifeq "$(wildcard $(AP_WORK)\modules\mod_edir)" "$(AP_WORK)\modules\mod_edir" SUBDIRS += mod_edir \ - $(EOLIST) + $(EOLIST) endif # Allow the experimental modules to be built if EXPERIMENTAL is defined ifdef EXPERIMENTAL SUBDIRS += experimental \ - $(EOLIST) + $(EOLIST) endif -# Allow the experimental modules to be built if EXPERIMENTAL is defined +# Allow the debug modules to be built if DEBUG is defined ifdef DEBUG SUBDIRS += debug \ - $(EOLIST) + $(EOLIST) endif @@ -72,4 +72,5 @@ endif # installation area # install :: nlms FORCE - + + diff --git a/modules/aaa/NWGNUauthbasc b/modules/aaa/NWGNUauthbasc index bc7e1ec9..e445bf85 100644 --- a/modules/aaa/NWGNUauthbasc +++ b/modules/aaa/NWGNUauthbasc @@ -28,7 +28,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -58,7 +57,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -72,7 +71,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -94,7 +93,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = authbasc +NLM_NAME = authbasc # # This is used by the link '-desc ' directive. @@ -112,7 +111,7 @@ NLM_THREAD_NAME = AuthBasic Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -138,14 +137,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -173,7 +172,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -215,13 +214,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ auth_basic_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -248,3 +247,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/aaa/NWGNUauthdigt b/modules/aaa/NWGNUauthdigt index 3b594b29..762c8533 100644 --- a/modules/aaa/NWGNUauthdigt +++ b/modules/aaa/NWGNUauthdigt @@ -28,7 +28,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -58,7 +57,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -72,7 +71,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -94,7 +93,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = authdigt +NLM_NAME = authdigt # # This is used by the link '-desc ' directive. @@ -112,7 +111,7 @@ NLM_THREAD_NAME = Digest Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -138,14 +137,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -173,7 +172,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -215,13 +214,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ auth_digest_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -248,3 +247,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/aaa/NWGNUauthnalias b/modules/aaa/NWGNUauthnalias index 3c8449ab..6dfbef6a 100644 --- a/modules/aaa/NWGNUauthnalias +++ b/modules/aaa/NWGNUauthnalias @@ -28,7 +28,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -58,7 +57,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -72,7 +71,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -94,7 +93,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = authnalias +NLM_NAME = authnalias # # This is used by the link '-desc ' directive. @@ -112,7 +111,7 @@ NLM_THREAD_NAME = AuthnAlias Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -138,14 +137,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -173,7 +172,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -215,13 +214,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ authn_alias_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -248,3 +247,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/aaa/NWGNUauthnano b/modules/aaa/NWGNUauthnano index 5bdd1c2f..0879e4a5 100644 --- a/modules/aaa/NWGNUauthnano +++ b/modules/aaa/NWGNUauthnano @@ -28,7 +28,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -58,7 +57,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -72,7 +71,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -94,7 +93,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = authnano +NLM_NAME = authnano # # This is used by the link '-desc ' directive. @@ -112,7 +111,7 @@ NLM_THREAD_NAME = AuthAnon Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -138,14 +137,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -173,7 +172,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -215,13 +214,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ authn_anon_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -248,3 +247,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/aaa/NWGNUauthndbd b/modules/aaa/NWGNUauthndbd index 9d7c15bf..10e3782b 100644 --- a/modules/aaa/NWGNUauthndbd +++ b/modules/aaa/NWGNUauthndbd @@ -58,7 +58,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -72,7 +72,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -94,7 +94,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = authndbd +NLM_NAME = authndbd # # This is used by the link '-desc ' directive. @@ -112,7 +112,7 @@ NLM_THREAD_NAME = AuthnDBD Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -138,14 +138,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -173,7 +173,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -215,13 +215,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ authn_dbd_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -248,3 +248,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/aaa/NWGNUauthndbm b/modules/aaa/NWGNUauthndbm index 9ebfd871..6dbe67f0 100644 --- a/modules/aaa/NWGNUauthndbm +++ b/modules/aaa/NWGNUauthndbm @@ -57,7 +57,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -71,7 +71,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -93,7 +93,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = authndbm +NLM_NAME = authndbm # # This is used by the link '-desc ' directive. @@ -111,7 +111,7 @@ NLM_THREAD_NAME = AuthnDBM Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -137,14 +137,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -172,7 +172,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -214,13 +214,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ authn_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) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -247,3 +247,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/aaa/NWGNUauthndef b/modules/aaa/NWGNUauthndef index e77d40dc..c6d2ce2f 100644 --- a/modules/aaa/NWGNUauthndef +++ b/modules/aaa/NWGNUauthndef @@ -28,7 +28,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -58,7 +57,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -72,7 +71,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -94,7 +93,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = authndef +NLM_NAME = authndef # # This is used by the link '-desc ' directive. @@ -112,7 +111,7 @@ NLM_THREAD_NAME = Authndef Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -138,14 +137,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -173,7 +172,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -215,13 +214,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ authn_default_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -248,3 +247,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/aaa/NWGNUauthnfil b/modules/aaa/NWGNUauthnfil index 1cfbb422..5bcb536d 100644 --- a/modules/aaa/NWGNUauthnfil +++ b/modules/aaa/NWGNUauthnfil @@ -28,7 +28,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -58,7 +57,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -72,7 +71,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -94,7 +93,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = authnfil +NLM_NAME = authnfil # # This is used by the link '-desc ' directive. @@ -112,7 +111,7 @@ NLM_THREAD_NAME = AuthnFile Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -138,14 +137,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -173,7 +172,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -215,13 +214,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ authn_file_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -248,3 +247,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/aaa/NWGNUauthnzldap b/modules/aaa/NWGNUauthnzldap index b1e996df..ffb475db 100644 --- a/modules/aaa/NWGNUauthnzldap +++ b/modules/aaa/NWGNUauthnzldap @@ -64,7 +64,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -78,7 +78,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -100,7 +100,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = authnzldap +NLM_NAME = authnzldap # # This is used by the link '-desc ' directive. @@ -118,7 +118,7 @@ NLM_THREAD_NAME = AuthnzLDAP Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -144,14 +144,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -179,7 +179,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -229,13 +229,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ authnz_ldap_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -262,3 +262,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/aaa/NWGNUauthzdbm b/modules/aaa/NWGNUauthzdbm index 1b7bd137..74a0d3da 100644 --- a/modules/aaa/NWGNUauthzdbm +++ b/modules/aaa/NWGNUauthzdbm @@ -28,7 +28,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -58,7 +57,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -72,7 +71,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -94,7 +93,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = authzdbm +NLM_NAME = authzdbm # # This is used by the link '-desc ' directive. @@ -112,7 +111,7 @@ NLM_THREAD_NAME = AuthzDBM Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -138,14 +137,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -173,7 +172,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -215,13 +214,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ authz_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) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -248,3 +247,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/aaa/NWGNUauthzdef b/modules/aaa/NWGNUauthzdef index 348785b0..8b5104ef 100644 --- a/modules/aaa/NWGNUauthzdef +++ b/modules/aaa/NWGNUauthzdef @@ -28,7 +28,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -58,7 +57,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -72,7 +71,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -94,7 +93,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = authzdef +NLM_NAME = authzdef # # This is used by the link '-desc ' directive. @@ -112,7 +111,7 @@ NLM_THREAD_NAME = Authzdef Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -138,14 +137,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -173,7 +172,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -215,13 +214,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ authz_default_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -248,3 +247,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/aaa/NWGNUauthzgrp b/modules/aaa/NWGNUauthzgrp index a104c4fd..7ed5dff3 100644 --- a/modules/aaa/NWGNUauthzgrp +++ b/modules/aaa/NWGNUauthzgrp @@ -28,7 +28,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -58,7 +57,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -72,7 +71,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -94,7 +93,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = authzgrp +NLM_NAME = authzgrp # # This is used by the link '-desc ' directive. @@ -112,7 +111,7 @@ NLM_THREAD_NAME = AuthzGrp Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -138,14 +137,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -173,7 +172,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -215,13 +214,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ authz_groupfile_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -248,3 +247,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/aaa/NWGNUauthzusr b/modules/aaa/NWGNUauthzusr index eb9e2c93..a97c253c 100644 --- a/modules/aaa/NWGNUauthzusr +++ b/modules/aaa/NWGNUauthzusr @@ -28,7 +28,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -58,7 +57,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -72,7 +71,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -94,7 +93,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = authzusr +NLM_NAME = authzusr # # This is used by the link '-desc ' directive. @@ -112,7 +111,7 @@ NLM_THREAD_NAME = AuthzUser Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -138,14 +137,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -173,7 +172,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -215,7 +214,7 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ authz_user_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character @@ -248,3 +247,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/aaa/NWGNUmakefile b/modules/aaa/NWGNUmakefile index 0809983d..9ef2cf04 100644 --- a/modules/aaa/NWGNUmakefile +++ b/modules/aaa/NWGNUmakefile @@ -59,7 +59,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -73,7 +73,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -95,7 +95,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = +NLM_NAME = # # This is used by the link '-desc ' directive. @@ -113,7 +113,7 @@ NLM_THREAD_NAME = # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -139,14 +139,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = +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 = +XDCDATA = # # If there is an NLM target, put it here @@ -226,13 +226,13 @@ FILES_nlm_Ximports = \ # 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) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -247,7 +247,7 @@ nlms :: libs $(TARGET_nlm) # correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) # install :: nlms FORCE - copy $(OBJDIR)\*.nlm $(INSTALL)\Apache2\modules\*.* + copy $(OBJDIR)\*.nlm $(INSTALL)\$(BASEDIR)\modules\*.* # # Any specialized rules here @@ -259,4 +259,5 @@ install :: nlms FORCE # include $(AP_WORK)\build\NWGNUtail.inc - + + diff --git a/modules/aaa/mod_auth_basic.dsp b/modules/aaa/mod_auth_basic.dsp index 54eda790..b45264ea 100644 --- a/modules/aaa/mod_auth_basic.dsp +++ b/modules/aaa/mod_auth_basic.dsp @@ -52,8 +52,14 @@ 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_auth_basic.so" /base:@..\..\os\win32\BaseAddr.ref,mod_auth_basic.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_auth_basic.so" /base:@..\..\os\win32\BaseAddr.ref,mod_auth_basic.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_auth_basic.so" /base:@..\..\os\win32\BaseAddr.ref,mod_auth_basic.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_auth_basic.so" /base:@..\..\os\win32\BaseAddr.ref,mod_auth_basic.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_auth_basic.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_auth_basic - Win32 Debug" @@ -78,8 +84,14 @@ 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_auth_basic.so" /base:@..\..\os\win32\BaseAddr.ref,mod_auth_basic.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_auth_basic.so" /base:@..\..\os\win32\BaseAddr.ref,mod_auth_basic.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_auth_basic.so" /base:@..\..\os\win32\BaseAddr.ref,mod_auth_basic.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_auth_basic.so" /base:@..\..\os\win32\BaseAddr.ref,mod_auth_basic.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_auth_basic.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 diff --git a/modules/aaa/mod_auth_digest.dsp b/modules/aaa/mod_auth_digest.dsp index af8321d7..9d1bee1f 100644 --- a/modules/aaa/mod_auth_digest.dsp +++ b/modules/aaa/mod_auth_digest.dsp @@ -52,8 +52,14 @@ 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_auth_digest.so" /base:@..\..\os\win32\BaseAddr.ref,mod_auth_digest.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_auth_digest.so" /base:@..\..\os\win32\BaseAddr.ref,mod_auth_digest.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_auth_digest.so" /base:@..\..\os\win32\BaseAddr.ref,mod_auth_digest.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_auth_digest.so" /base:@..\..\os\win32\BaseAddr.ref,mod_auth_digest.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_auth_digest.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_auth_digest - Win32 Debug" @@ -78,8 +84,14 @@ 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_auth_digest.so" /base:@..\..\os\win32\BaseAddr.ref,mod_auth_digest.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_auth_digest.so" /base:@..\..\os\win32\BaseAddr.ref,mod_auth_digest.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_auth_digest.so" /base:@..\..\os\win32\BaseAddr.ref,mod_auth_digest.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_auth_digest.so" /base:@..\..\os\win32\BaseAddr.ref,mod_auth_digest.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_auth_digest.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 diff --git a/modules/aaa/mod_authn_alias.dsp b/modules/aaa/mod_authn_alias.dsp new file mode 100644 index 00000000..238082f6 --- /dev/null +++ b/modules/aaa/mod_authn_alias.dsp @@ -0,0 +1,111 @@ +# Microsoft Developer Studio Project File - Name="mod_authn_alias" - 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_authn_alias - 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_authn_alias.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_authn_alias.mak" CFG="mod_authn_alias - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "mod_authn_alias - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "mod_authn_alias - 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_authn_alias - 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_authn_alias_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_authn_alias.res" /i "../../include" /i "../../srclib/apr/include" /d "NDEBUG" /d BIN_NAME="mod_authn_alias.so" /d LONG_NAME="authn_alias_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_authn_alias.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_alias.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_authn_alias.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_alias.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_authn_alias.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_authn_alias - 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_authn_alias_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_authn_alias.res" /i "../../include" /i "../../srclib/apr/include" /d "_DEBUG" /d BIN_NAME="mod_authn_alias.so" /d LONG_NAME="authn_alias_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_authn_alias.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_alias.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_authn_alias.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_alias.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_authn_alias.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_authn_alias - Win32 Release" +# Name "mod_authn_alias - Win32 Debug" +# Begin Source File + +SOURCE=.\mod_authn_alias.c +# End Source File +# Begin Source File + +SOURCE=..\..\build\win32\httpd.rc +# End Source File +# End Target +# End Project diff --git a/modules/aaa/mod_authn_anon.dsp b/modules/aaa/mod_authn_anon.dsp index acc1ce93..be881045 100644 --- a/modules/aaa/mod_authn_anon.dsp +++ b/modules/aaa/mod_authn_anon.dsp @@ -52,8 +52,14 @@ 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_authn_anon.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_anon.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_authn_anon.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_anon.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_authn_anon.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_anon.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_authn_anon.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_anon.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_authn_anon.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_authn_anon - Win32 Debug" @@ -78,8 +84,14 @@ 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_authn_anon.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_anon.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_authn_anon.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_anon.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_authn_anon.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_anon.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_authn_anon.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_anon.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_authn_anon.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 diff --git a/modules/aaa/mod_authn_dbd.dsp b/modules/aaa/mod_authn_dbd.dsp index 24889381..9094d339 100644 --- a/modules/aaa/mod_authn_dbd.dsp +++ b/modules/aaa/mod_authn_dbd.dsp @@ -52,8 +52,14 @@ 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_authn_dbd.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_dbd.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_authn_dbd.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_dbd.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_authn_dbd.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_dbd.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_authn_dbd.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_dbd.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_authn_dbd.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_authn_dbd - Win32 Debug" @@ -78,8 +84,14 @@ 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_authn_dbd.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_dbd.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_authn_dbd.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_dbd.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_authn_dbd.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_dbd.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_authn_dbd.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_dbd.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_authn_dbd.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 diff --git a/modules/aaa/mod_authn_dbm.dsp b/modules/aaa/mod_authn_dbm.dsp index 4c1400ed..f2c3ff82 100644 --- a/modules/aaa/mod_authn_dbm.dsp +++ b/modules/aaa/mod_authn_dbm.dsp @@ -52,8 +52,14 @@ 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_authn_dbm.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_dbm.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_authn_dbm.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_dbm.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_authn_dbm.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_dbm.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_authn_dbm.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_dbm.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_authn_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_authn_dbm - Win32 Debug" @@ -78,8 +84,14 @@ 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_authn_dbm.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_dbm.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_authn_dbm.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_dbm.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_authn_dbm.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_dbm.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_authn_dbm.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_dbm.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_authn_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 diff --git a/modules/aaa/mod_authn_default.dsp b/modules/aaa/mod_authn_default.dsp index 23db2061..89d55b0f 100644 --- a/modules/aaa/mod_authn_default.dsp +++ b/modules/aaa/mod_authn_default.dsp @@ -52,8 +52,14 @@ 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_authn_default.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_default.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_authn_default.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_default.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_authn_default.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_default.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_authn_default.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_default.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_authn_default.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_authn_default - Win32 Debug" @@ -78,8 +84,14 @@ 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_authn_default.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_default.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_authn_default.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_default.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_authn_default.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_default.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_authn_default.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_default.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_authn_default.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 diff --git a/modules/aaa/mod_authn_file.dsp b/modules/aaa/mod_authn_file.dsp index 0d719210..4dc03d50 100644 --- a/modules/aaa/mod_authn_file.dsp +++ b/modules/aaa/mod_authn_file.dsp @@ -52,8 +52,14 @@ 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_authn_file.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_file.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_authn_file.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_file.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_authn_file.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_file.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_authn_file.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_file.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_authn_file.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_authn_file - Win32 Debug" @@ -78,8 +84,14 @@ 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_authn_file.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_file.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_authn_file.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_file.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_authn_file.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_file.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_authn_file.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authn_file.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_authn_file.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 diff --git a/modules/aaa/mod_authnz_ldap.c b/modules/aaa/mod_authnz_ldap.c index 4f3d1ca0..f520b0ae 100644 --- a/modules/aaa/mod_authnz_ldap.c +++ b/modules/aaa/mod_authnz_ldap.c @@ -512,6 +512,7 @@ static int authz_ldap_check_user_access(request_rec *r) const char *t; char *w, *value; int method_restricted = 0; + int required_ldap = 0; char filtbuf[FILTER_LENGTH]; const char *dn = NULL; @@ -615,6 +616,7 @@ static int authz_ldap_check_user_access(request_rec *r) w = ap_getword_white(r->pool, &t); if (strcmp(w, "ldap-user") == 0) { + required_ldap = 1; if (req->dn == NULL || strlen(req->dn) == 0) { ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: " @@ -664,6 +666,7 @@ static int authz_ldap_check_user_access(request_rec *r) } } else if (strcmp(w, "ldap-dn") == 0) { + required_ldap = 1; if (req->dn == NULL || strlen(req->dn) == 0) { ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: " @@ -691,6 +694,7 @@ static int authz_ldap_check_user_access(request_rec *r) else if (strcmp(w, "ldap-group") == 0) { struct mod_auth_ldap_groupattr_entry_t *ent = (struct mod_auth_ldap_groupattr_entry_t *) sec->groupattr->elts; int i; + required_ldap = 1; if (sec->group_attrib_is_dn) { if (req->dn == NULL || strlen(req->dn) == 0) { @@ -740,6 +744,7 @@ static int authz_ldap_check_user_access(request_rec *r) } } else if (strcmp(w, "ldap-attribute") == 0) { + required_ldap = 1; if (req->dn == NULL || strlen(req->dn) == 0) { ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: " @@ -775,6 +780,7 @@ static int authz_ldap_check_user_access(request_rec *r) } } else if (strcmp(w, "ldap-filter") == 0) { + required_ldap = 1; if (req->dn == NULL || strlen(req->dn) == 0) { ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: " @@ -838,7 +844,7 @@ static int authz_ldap_check_user_access(request_rec *r) return OK; } - if (!sec->auth_authoritative) { + if (!required_ldap || !sec->auth_authoritative) { ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: declining to authorise", getpid()); return DECLINED; diff --git a/modules/aaa/mod_authnz_ldap.dsp b/modules/aaa/mod_authnz_ldap.dsp index e688799c..e2ed9293 100644 --- a/modules/aaa/mod_authnz_ldap.dsp +++ b/modules/aaa/mod_authnz_ldap.dsp @@ -52,8 +52,14 @@ 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_authnz_ldap.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authnz_ldap.so -# ADD LINK32 kernel32.lib wldap32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_authnz_ldap.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authnz_ldap.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_authnz_ldap.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authnz_ldap.so +# ADD LINK32 kernel32.lib wldap32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_authnz_ldap.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authnz_ldap.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_authnz_ldap.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_authnz_ldap - Win32 Debug" @@ -78,8 +84,14 @@ 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_authnz_ldap.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authnz_ldap.so -# ADD LINK32 kernel32.lib wldap32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_authnz_ldap.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authnz_ldap.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_authnz_ldap.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authnz_ldap.so +# ADD LINK32 kernel32.lib wldap32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_authnz_ldap.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authnz_ldap.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_authnz_ldap.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 diff --git a/modules/aaa/mod_authz_dbm.dsp b/modules/aaa/mod_authz_dbm.dsp index 0d91767f..9ac2993a 100644 --- a/modules/aaa/mod_authz_dbm.dsp +++ b/modules/aaa/mod_authz_dbm.dsp @@ -52,8 +52,14 @@ 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_authz_dbm.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_dbm.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_authz_dbm.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_dbm.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_authz_dbm.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_dbm.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_authz_dbm.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_dbm.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_authz_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_authz_dbm - Win32 Debug" @@ -78,8 +84,14 @@ 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_authz_dbm.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_dbm.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_authz_dbm.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_dbm.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_authz_dbm.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_dbm.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_authz_dbm.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_dbm.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_authz_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 diff --git a/modules/aaa/mod_authz_default.dsp b/modules/aaa/mod_authz_default.dsp index 2593a1f7..b02dca47 100644 --- a/modules/aaa/mod_authz_default.dsp +++ b/modules/aaa/mod_authz_default.dsp @@ -52,8 +52,14 @@ 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_authz_default.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_default.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_authz_default.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_default.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_authz_default.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_default.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_authz_default.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_default.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_authz_default.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_authz_default - Win32 Debug" @@ -78,8 +84,14 @@ 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_authz_default.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_default.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_authz_default.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_default.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_authz_default.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_default.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_authz_default.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_default.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_authz_default.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 diff --git a/modules/aaa/mod_authz_groupfile.dsp b/modules/aaa/mod_authz_groupfile.dsp index 7649fccf..efea1691 100644 --- a/modules/aaa/mod_authz_groupfile.dsp +++ b/modules/aaa/mod_authz_groupfile.dsp @@ -52,8 +52,14 @@ 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_authz_groupfile.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_groupfile.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_authz_groupfile.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_groupfile.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_authz_groupfile.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_groupfile.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_authz_groupfile.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_groupfile.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_authz_groupfile.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_authz_groupfile - Win32 Debug" @@ -78,8 +84,14 @@ 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_authz_groupfile.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_groupfile.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_authz_groupfile.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_groupfile.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_authz_groupfile.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_groupfile.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_authz_groupfile.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_groupfile.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_authz_groupfile.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 diff --git a/modules/aaa/mod_authz_host.dsp b/modules/aaa/mod_authz_host.dsp index ae57ff5c..e4176872 100644 --- a/modules/aaa/mod_authz_host.dsp +++ b/modules/aaa/mod_authz_host.dsp @@ -52,8 +52,14 @@ 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_authz_host.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_host.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_authz_host.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_host.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_authz_host.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_host.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_authz_host.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_host.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_authz_host.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_authz_host - Win32 Debug" @@ -78,8 +84,14 @@ 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_authz_host.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_host.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_authz_host.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_host.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_authz_host.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_host.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_authz_host.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_host.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_authz_host.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 diff --git a/modules/aaa/mod_authz_owner.dsp b/modules/aaa/mod_authz_owner.dsp new file mode 100644 index 00000000..e026a282 --- /dev/null +++ b/modules/aaa/mod_authz_owner.dsp @@ -0,0 +1,111 @@ +# Microsoft Developer Studio Project File - Name="mod_authz_owner" - 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_authz_owner - 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_authz_owner.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_authz_owner.mak" CFG="mod_authz_owner - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "mod_authz_owner - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "mod_authz_owner - 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_authz_owner - 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_authz_owner_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_authz_owner.res" /i "../../include" /i "../../srclib/apr/include" /d "NDEBUG" /d BIN_NAME="mod_authz_owner.so" /d LONG_NAME="authz_owner_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_authz_owner.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_owner.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_authz_owner.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_owner.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_authz_owner.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_authz_owner - 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_authz_owner_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_authz_owner.res" /i "../../include" /i "../../srclib/apr/include" /d "_DEBUG" /d BIN_NAME="mod_authz_owner.so" /d LONG_NAME="authz_owner_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_authz_owner.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_owner.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_authz_owner.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_owner.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_authz_owner.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_authz_owner - Win32 Release" +# Name "mod_authz_owner - Win32 Debug" +# Begin Source File + +SOURCE=.\mod_authz_owner.c +# End Source File +# Begin Source File + +SOURCE=..\..\build\win32\httpd.rc +# End Source File +# End Target +# End Project diff --git a/modules/aaa/mod_authz_user.dsp b/modules/aaa/mod_authz_user.dsp index 4791388b..91d80a61 100644 --- a/modules/aaa/mod_authz_user.dsp +++ b/modules/aaa/mod_authz_user.dsp @@ -52,8 +52,14 @@ 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_authz_user.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_user.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_authz_user.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_user.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_authz_user.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_user.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_authz_user.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_user.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_authz_user.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_authz_user - Win32 Debug" @@ -78,8 +84,14 @@ 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_authz_user.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_user.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_authz_user.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_user.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_authz_user.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_user.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_authz_user.so" /base:@..\..\os\win32\BaseAddr.ref,mod_authz_user.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_authz_user.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 diff --git a/modules/arch/win32/mod_isapi.dsp b/modules/arch/win32/mod_isapi.dsp index 0837de28..39df3e40 100644 --- a/modules/arch/win32/mod_isapi.dsp +++ b/modules/arch/win32/mod_isapi.dsp @@ -52,8 +52,14 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /out:"Release/mod_isapi.so" /base:@..\..\..\os\win32\BaseAddr.ref,mod_isapi.so -# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_isapi.so" /base:@..\..\..\os\win32\BaseAddr.ref,mod_isapi.so /opt:ref +# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /out:".\Release\mod_isapi.so" /base:@..\..\..\os\win32\BaseAddr.ref,mod_isapi.so +# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_isapi.so" /base:@..\..\..\os\win32\BaseAddr.ref,mod_isapi.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_isapi.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_isapi - Win32 Debug" @@ -78,8 +84,14 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_isapi.so" /base:@..\..\..\os\win32\BaseAddr.ref,mod_isapi.so -# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_isapi.so" /base:@..\..\..\os\win32\BaseAddr.ref,mod_isapi.so +# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_isapi.so" /base:@..\..\..\os\win32\BaseAddr.ref,mod_isapi.so +# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_isapi.so" /base:@..\..\..\os\win32\BaseAddr.ref,mod_isapi.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_isapi.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 diff --git a/modules/cache/NWGNUdsk_cach b/modules/cache/NWGNUdsk_cach index 9dc385e7..b91823dd 100644 --- a/modules/cache/NWGNUdsk_cach +++ b/modules/cache/NWGNUdsk_cach @@ -65,7 +65,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -79,7 +79,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -101,7 +101,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = dsk_cach +NLM_NAME = dsk_cach # # This is used by the link '-desc ' directive. @@ -119,7 +119,7 @@ NLM_THREAD_NAME = dsk_cach # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -145,14 +145,14 @@ NLM_CHECK_SYM = # # If this is specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # Declare all target files (you must add your files here) @@ -184,7 +184,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -228,14 +228,14 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ disk_cache_module \ $(EOLIST) - + # @cache.imp \ # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -263,4 +263,3 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc - diff --git a/modules/cache/NWGNUmakefile b/modules/cache/NWGNUmakefile index 71d7e1ba..868db548 100644 --- a/modules/cache/NWGNUmakefile +++ b/modules/cache/NWGNUmakefile @@ -59,7 +59,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -73,7 +73,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -95,7 +95,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = +NLM_NAME = # # This is used by the link '-desc ' directive. @@ -113,7 +113,7 @@ NLM_THREAD_NAME = # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -139,14 +139,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = +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 = +XDCDATA = # # If there is an NLM target, put it here @@ -156,7 +156,7 @@ TARGET_nlm = \ $(OBJDIR)/mem_cach.nlm \ $(OBJDIR)/dsk_cach.nlm \ $(EOLIST) - + # # If there is an LIB target, put it here # @@ -216,7 +216,7 @@ FILES_nlm_exports = \ # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -231,7 +231,7 @@ nlms :: libs $(TARGET_nlm) # correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) # install :: nlms FORCE - copy $(OBJDIR)\*.nlm $(INSTALL)\Apache2\modules\*.* + copy $(OBJDIR)\*.nlm $(INSTALL)\$(BASEDIR)\modules\*.* # # Any specialized rules here @@ -244,3 +244,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/cache/NWGNUmem_cach b/modules/cache/NWGNUmem_cach index 782d8834..bcf98e7f 100644 --- a/modules/cache/NWGNUmem_cach +++ b/modules/cache/NWGNUmem_cach @@ -66,7 +66,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -80,7 +80,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -102,7 +102,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = mem_cach +NLM_NAME = mem_cach # # This is used by the link '-desc ' directive. @@ -120,7 +120,7 @@ NLM_THREAD_NAME = mem_cach # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -146,14 +146,14 @@ NLM_CHECK_SYM = # # If this is specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # Declare all target files (you must add your files here) @@ -188,7 +188,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -232,14 +232,14 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ mem_cache_module \ $(EOLIST) - + # @cache.imp \ # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -267,4 +267,3 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc - diff --git a/modules/cache/NWGNUmod_cach b/modules/cache/NWGNUmod_cach index 125c4567..ff0a9667 100644 --- a/modules/cache/NWGNUmod_cach +++ b/modules/cache/NWGNUmod_cach @@ -66,7 +66,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -80,7 +80,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -102,7 +102,7 @@ endif # 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 +NLM_NAME = mod_cach # # This is used by the link '-desc ' directive. @@ -120,7 +120,7 @@ NLM_THREAD_NAME = mod_cach # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -146,14 +146,14 @@ NLM_CHECK_SYM = # # If this is specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # Declare all target files (you must add your files here) @@ -182,13 +182,12 @@ FILES_nlm_objs = \ $(OBJDIR)/mod_cache.o \ $(EOLIST) -# $(OBJDIR)/mod_mem_cache.o \ # # 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 = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -232,13 +231,13 @@ 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) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -266,4 +265,3 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc - diff --git a/modules/cache/cache_cache.c b/modules/cache/cache_cache.c index 6db98f71..860800bb 100644 --- a/modules/cache/cache_cache.c +++ b/modules/cache/cache_cache.c @@ -85,13 +85,7 @@ CACHE_DECLARE(void) cache_free(cache_cache_t *c) CACHE_DECLARE(void*) cache_find(cache_cache_t* c, const char *key) { - void *e; - - e = cache_hash_get(c->ht, key, CACHE_HASH_KEY_STRING); - if (!e) - return NULL; - - return e; + return cache_hash_get(c->ht, key, CACHE_HASH_KEY_STRING); } CACHE_DECLARE(void) cache_update(cache_cache_t* c, void *entry) diff --git a/modules/cache/cache_storage.c b/modules/cache/cache_storage.c index 83352059..0ddf82dd 100644 --- a/modules/cache/cache_storage.c +++ b/modules/cache/cache_storage.c @@ -304,6 +304,20 @@ int cache_select(request_rec *r) } cache->stale_handle = h; } + else { + int irv; + + /* + * The copy isn't fresh enough, but we cannot revalidate. + * So it is the same case as if there had not been a cached + * entry at all. Thus delete the entry from cache. + */ + irv = cache->provider->remove_url(h, r->pool); + if (irv != OK) { + ap_log_error(APLOG_MARK, APLOG_DEBUG, irv, r->server, + "cache: attempt to remove url from cache unsuccessful."); + } + } return DECLINED; } @@ -331,10 +345,38 @@ int cache_select(request_rec *r) apr_status_t cache_generate_key_default(request_rec *r, apr_pool_t* p, char**key) { + cache_server_conf *conf; + cache_request_rec *cache; char *port_str, *hn, *lcs; const char *hostname, *scheme; int i; + cache = (cache_request_rec *) ap_get_module_config(r->request_config, + &cache_module); + if (!cache) { + /* This should never happen */ + ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server, + "cache: No cache request information available for key" + " generation"); + *key = ""; + return APR_EGENERAL; + } + if (cache->key) { + /* + * We have been here before during the processing of this request. + * So return the key we already have. + */ + *key = apr_pstrdup(p, cache->key); + 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. @@ -425,9 +467,25 @@ apr_status_t cache_generate_key_default(request_rec *r, apr_pool_t* p, port_str = apr_psprintf(p, ":%u", ap_get_server_port(r)); } - /* Key format is a URI */ - *key = apr_pstrcat(p, scheme, "://", hostname, port_str, - r->parsed_uri.path, "?", r->args, NULL); + /* Key format is a URI, optionally without the query-string */ + if (conf->ignorequerystring) { + *key = apr_pstrcat(p, scheme, "://", hostname, port_str, + r->parsed_uri.path, "?", NULL); + } + else { + *key = apr_pstrcat(p, scheme, "://", hostname, port_str, + r->parsed_uri.path, "?", r->parsed_uri.query, 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. + */ + cache->key = apr_pstrdup(r->pool, *key); return APR_SUCCESS; } diff --git a/modules/cache/cache_util.c b/modules/cache/cache_util.c index d7dd14a8..75d35bd6 100644 --- a/modules/cache/cache_util.c +++ b/modules/cache/cache_util.c @@ -243,7 +243,8 @@ CACHE_DECLARE(int) ap_cache_check_freshness(cache_handle_t *h, age = ap_cache_current_age(info, age_c, r->request_time); /* extract s-maxage */ - if (cc_cresp && ap_cache_liststr(r->pool, cc_cresp, "s-maxage", &val)) { + if (cc_cresp && ap_cache_liststr(r->pool, cc_cresp, "s-maxage", &val) + && val != NULL) { smaxage = apr_atoi64(val); } else { @@ -252,7 +253,8 @@ CACHE_DECLARE(int) ap_cache_check_freshness(cache_handle_t *h, /* extract max-age from request */ if (!conf->ignorecachecontrol - && cc_req && ap_cache_liststr(r->pool, cc_req, "max-age", &val)) { + && cc_req && ap_cache_liststr(r->pool, cc_req, "max-age", &val) + && val != NULL) { maxage_req = apr_atoi64(val); } else { @@ -260,7 +262,8 @@ CACHE_DECLARE(int) ap_cache_check_freshness(cache_handle_t *h, } /* extract max-age from response */ - if (cc_cresp && ap_cache_liststr(r->pool, cc_cresp, "max-age", &val)) { + if (cc_cresp && ap_cache_liststr(r->pool, cc_cresp, "max-age", &val) + && val != NULL) { maxage_cresp = apr_atoi64(val); } else { @@ -282,7 +285,20 @@ CACHE_DECLARE(int) ap_cache_check_freshness(cache_handle_t *h, /* extract max-stale */ if (cc_req && ap_cache_liststr(r->pool, cc_req, "max-stale", &val)) { - maxstale = apr_atoi64(val); + if(val != NULL) { + maxstale = apr_atoi64(val); + } + else { + /* + * If no value is assigned to max-stale, then the client is willing + * to accept a stale response of any age (RFC2616 14.9.3). We will + * set it to one year in this case as this situation is somewhat + * similar to a "never expires" Expires header (RFC2616 14.21) + * which is set to a date one year from the time the response is + * sent in this case. + */ + maxstale = APR_INT64_C(86400*365); + } } else { maxstale = 0; @@ -290,7 +306,8 @@ CACHE_DECLARE(int) ap_cache_check_freshness(cache_handle_t *h, /* extract min-fresh */ if (!conf->ignorecachecontrol - && cc_req && ap_cache_liststr(r->pool, cc_req, "min-fresh", &val)) { + && cc_req && ap_cache_liststr(r->pool, cc_req, "min-fresh", &val) + && val != NULL) { minfresh = apr_atoi64(val); } else { @@ -419,6 +436,9 @@ CACHE_DECLARE(int) ap_cache_liststr(apr_pool_t *p, const char *list, next - val_start); } } + else { + *val = NULL; + } } return 1; } diff --git a/modules/cache/mod_cache.c b/modules/cache/mod_cache.c index 707aaf77..51341179 100644 --- a/modules/cache/mod_cache.c +++ b/modules/cache/mod_cache.c @@ -56,6 +56,8 @@ static int cache_url_handler(request_rec *r, int lookup) cache_request_rec *cache; cache_server_conf *conf; apr_bucket_brigade *out; + ap_filter_t *next; + ap_filter_rec_t *cache_out_handle; /* Delay initialization until we know we are handling a GET */ if (r->method_number != M_GET) { @@ -213,12 +215,29 @@ static int cache_url_handler(request_rec *r, int lookup) * or not. */ if (r->main) { - ap_add_output_filter_handle(cache_out_subreq_filter_handle, NULL, - r, r->connection); + cache_out_handle = cache_out_subreq_filter_handle; } else { - ap_add_output_filter_handle(cache_out_filter_handle, NULL, - r, r->connection); + cache_out_handle = cache_out_filter_handle; + } + ap_add_output_filter_handle(cache_out_handle, NULL, r, r->connection); + + /* + * Remove all filters that are before the cache_out filter. This ensures + * that we kick off the filter stack with our cache_out filter being the + * first in the chain. This make sense because we want to restore things + * in the same manner as we saved them. + * There may be filters before our cache_out filter, because + * + * 1. We call ap_set_content_type during cache_select. This causes + * Content-Type specific filters to be added. + * 2. We call the insert_filter hook. This causes filters e.g. like + * the ones set with SetOutputFilter to be added. + */ + next = r->output_filters; + while (next && (next->frec != cache_out_handle)) { + ap_remove_output_filter(next); + next = next->next; } /* kick off the filter stack */ @@ -299,7 +318,6 @@ static int cache_out_filter(ap_filter_t *f, apr_bucket_brigade *bb) static int cache_save_filter(ap_filter_t *f, apr_bucket_brigade *in) { int rv = !OK; - int date_in_errhdr = 0; request_rec *r = f->r; cache_request_rec *cache; cache_server_conf *conf; @@ -433,11 +451,12 @@ static int cache_save_filter(ap_filter_t *f, apr_bucket_brigade *in) /* if a Expires header is in the past, don't cache it */ reason = "Expires header already expired, not cacheable"; } - else if (r->args && exps == NULL) { - /* if query string present but no expiration time, don't cache it - * (RFC 2616/13.9) + else if (!conf->ignorequerystring && r->parsed_uri.query && exps == NULL && + !ap_cache_liststr(NULL, cc_out, "max-age", NULL)) { + /* if a query string is present but no explicit expiration time, + * don't cache it (RFC 2616/13.9 & 13.2.1) */ - reason = "Query string present but no expires header"; + reason = "Query string present but no explicit expiration time"; } else if (r->status == HTTP_NOT_MODIFIED && !cache->handle && !cache->stale_handle) { @@ -456,8 +475,8 @@ static int cache_save_filter(ap_filter_t *f, apr_bucket_brigade *in) */ reason = "No Last-Modified, Etag, or Expires headers"; } - else if (r->header_only) { - /* HEAD requests */ + else if (r->header_only && !cache->stale_handle) { + /* Forbid HEAD requests unless we have it cached already */ reason = "HTTP HEAD request"; } else if (!conf->store_nostore && @@ -576,7 +595,12 @@ static int cache_save_filter(ap_filter_t *f, apr_bucket_brigade *in) * the headers). */ - /* Did we have a stale cache entry that really is stale? */ + /* Did we have a stale cache entry that really is stale? + * + * Note that for HEAD requests, we won't get the body, so for a stale + * HEAD request, we don't remove the entity - instead we let the + * CACHE_REMOVE_URL filter remove the stale item from the cache. + */ if (cache->stale_handle) { if (r->status == HTTP_NOT_MODIFIED) { /* Oh, hey. It isn't that stale! Yay! */ @@ -584,7 +608,7 @@ static int cache_save_filter(ap_filter_t *f, apr_bucket_brigade *in) info = &cache->handle->cache_obj->info; rv = OK; } - else { + else if (!r->header_only) { /* Oh, well. Toss it. */ cache->provider->remove_entity(cache->stale_handle); /* Treat the request as if it wasn't conditional. */ @@ -592,8 +616,8 @@ static int cache_save_filter(ap_filter_t *f, apr_bucket_brigade *in) } } - /* no cache handle, create a new entity */ - if (!cache->handle) { + /* no cache handle, create a new entity only for non-HEAD requests */ + if (!cache->handle && !r->header_only) { rv = cache_create_entity(r, size); info = apr_pcalloc(r->pool, sizeof(cache_info)); /* We only set info->status upon the initial creation. */ @@ -628,10 +652,7 @@ static int cache_save_filter(ap_filter_t *f, apr_bucket_brigade *in) /* Read the date. Generate one if one is not supplied */ dates = apr_table_get(r->err_headers_out, "Date"); - if (dates != NULL) { - date_in_errhdr = 1; - } - else { + if (dates == NULL) { dates = apr_table_get(r->headers_out, "Date"); } if (dates != NULL) { @@ -643,25 +664,10 @@ static int cache_save_filter(ap_filter_t *f, apr_bucket_brigade *in) now = apr_time_now(); if (info->date == APR_DATE_BAD) { /* No, or bad date */ - char *dates; /* no date header (or bad header)! */ - /* add one; N.B. use the time _now_ rather than when we were checking - * the cache - */ - if (date_in_errhdr == 1) { - apr_table_unset(r->err_headers_out, "Date"); - } - date = now; - dates = apr_pcalloc(r->pool, MAX_STRING_LEN); - apr_rfc822_date(dates, now); - apr_table_set(r->headers_out, "Date", dates); - ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, - "cache: Added date header"); - info->date = date; - } - else { - date = info->date; + info->date = now; } + date = info->date; /* set response_time for HTTP/1.1 age calculations */ info->response_time = now; @@ -681,32 +687,47 @@ static int cache_save_filter(ap_filter_t *f, apr_bucket_brigade *in) } /* if no expiry date then - * if lastmod + * if Cache-Control: max-age present + * expiry date = date + max-age + * else if lastmod * expiry date = date + min((date - lastmod) * factor, maxexpire) * else * expire date = date + defaultexpire */ if (exp == APR_DATE_BAD) { - char expire_hdr[APR_RFC822_DATE_LEN]; + char *max_age_val; - /* if lastmod == date then you get 0*conf->factor which results in - * an expiration time of now. This causes some problems with - * freshness calculations, so we choose the else path... - */ - if ((lastmod != APR_DATE_BAD) && (lastmod < date)) { + if (ap_cache_liststr(r->pool, cc_out, "max-age", &max_age_val) && + max_age_val != NULL) { + apr_int64_t x; + + errno = 0; + x = apr_atoi64(max_age_val); + if (errno) { + x = conf->defex; + } + else { + x = x * MSEC_ONE_SEC; + } + if (x > conf->maxex) { + x = conf->maxex; + } + exp = date + x; + } + else if ((lastmod != APR_DATE_BAD) && (lastmod < date)) { + /* if lastmod == date then you get 0*conf->factor which results in + * an expiration time of now. This causes some problems with + * freshness calculations, so we choose the else path... + */ apr_time_t x = (apr_time_t) ((date - lastmod) * conf->factor); if (x > conf->maxex) { x = conf->maxex; } exp = date + x; - apr_rfc822_date(expire_hdr, exp); - apr_table_set(r->headers_out, "Expires", expire_hdr); } else { exp = date + conf->defex; - apr_rfc822_date(expire_hdr, exp); - apr_table_set(r->headers_out, "Expires", expire_hdr); } } info->expire = exp; @@ -896,6 +917,9 @@ static void * create_cache_config(apr_pool_t *p, server_rec *s) /* array of headers that should not be stored in cache */ ps->ignore_headers = apr_array_make(p, 10, sizeof(char *)); ps->ignore_headers_set = CACHE_IGNORE_HEADERS_UNSET; + /* flag indicating that query-string should be ignored when caching */ + ps->ignorequerystring = 0; + ps->ignorequerystring_set = 0; return ps; } @@ -941,6 +965,10 @@ static void * merge_cache_config(apr_pool_t *p, void *basev, void *overridesv) (overrides->ignore_headers_set == CACHE_IGNORE_HEADERS_UNSET) ? base->ignore_headers : overrides->ignore_headers; + ps->ignorequerystring = + (overrides->ignorequerystring_set == 0) + ? base->ignorequerystring + : overrides->ignorequerystring; return ps; } static const char *set_cache_ignore_no_last_mod(cmd_parms *parms, void *dummy, @@ -1119,6 +1147,19 @@ static const char *set_cache_factor(cmd_parms *parms, void *dummy, return NULL; } +static const char *set_cache_ignore_querystring(cmd_parms *parms, void *dummy, + int flag) +{ + cache_server_conf *conf; + + conf = + (cache_server_conf *)ap_get_module_config(parms->server->module_config, + &cache_module); + conf->ignorequerystring = flag; + conf->ignorequerystring_set = 1; + return NULL; +} + static int cache_post_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s) { @@ -1168,6 +1209,9 @@ static const command_rec cache_cmds[] = AP_INIT_ITERATE("CacheIgnoreHeaders", add_ignore_header, NULL, RSRC_CONF, "A space separated list of headers that should not be " "stored by the cache"), + AP_INIT_FLAG("CacheIgnoreQueryString", set_cache_ignore_querystring, + NULL, RSRC_CONF, + "Ignore query-string when caching"), AP_INIT_TAKE1("CacheLastModifiedFactor", set_cache_factor, NULL, RSRC_CONF, "The factor used to estimate Expires date from " "LastModified date"), diff --git a/modules/cache/mod_cache.dsp b/modules/cache/mod_cache.dsp index 4059498b..ba1653bf 100644 --- a/modules/cache/mod_cache.dsp +++ b/modules/cache/mod_cache.dsp @@ -53,7 +53,13 @@ BSC32=bscmake.exe # 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 +# 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" @@ -79,7 +85,13 @@ BSC32=bscmake.exe # 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 +# 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 diff --git a/modules/cache/mod_cache.h b/modules/cache/mod_cache.h index eb5c8ced..4fe8dfc4 100644 --- a/modules/cache/mod_cache.h +++ b/modules/cache/mod_cache.h @@ -150,6 +150,9 @@ typedef struct { #define CACHE_IGNORE_HEADERS_SET 1 #define CACHE_IGNORE_HEADERS_UNSET 0 int ignore_headers_set; + /** ignore query-string when caching */ + int ignorequerystring; + int ignorequerystring_set; } cache_server_conf; /* cache info information */ @@ -231,6 +234,9 @@ typedef struct { apr_time_t lastmod; /* last-modified time */ cache_info *info; /* current cache info */ ap_filter_t *remove_url_filter; /* Enable us to remove the filter */ + char *key; /* The cache key created for this + * request + */ } cache_request_rec; diff --git a/modules/cache/mod_disk_cache.c b/modules/cache/mod_disk_cache.c index 92c5ad75..6b3e7733 100644 --- a/modules/cache/mod_disk_cache.c +++ b/modules/cache/mod_disk_cache.c @@ -403,10 +403,6 @@ static int open_entity(cache_handle_t *h, request_rec *r, const char *key) len = sizeof(expire); apr_file_read_full(dobj->hfd, &expire, len, &len); - if (expire < r->request_time) { - return DECLINED; - } - varray = apr_array_make(r->pool, 5, sizeof(char*)); rc = read_array(r, varray, dobj->hfd); if (rc != APR_SUCCESS) { @@ -823,6 +819,15 @@ static apr_status_t store_headers(cache_handle_t *h, request_rec *r, cache_info apr_array_header_t* varray; apr_uint32_t format = VARY_FORMAT_VERSION; + /* If we were initially opened as a vary format, rollback + * that internal state for the moment so we can recreate the + * vary format hints in the appropriate directory. + */ + if (dobj->prefix) { + dobj->hdrsfile = dobj->prefix; + dobj->prefix = NULL; + } + mkdir_structure(conf, dobj->hdrsfile, r->pool); rv = apr_file_mktemp(&dobj->tfd, dobj->tempfile, @@ -875,8 +880,6 @@ static apr_status_t store_headers(cache_handle_t *h, request_rec *r, cache_info return rv; } - dobj->name = h->cache_obj->key; - disk_info.format = DISK_FORMAT_VERSION; disk_info.date = info->date; disk_info.expire = info->expire; diff --git a/modules/cache/mod_disk_cache.dsp b/modules/cache/mod_disk_cache.dsp index bb6af078..91799b85 100644 --- a/modules/cache/mod_disk_cache.dsp +++ b/modules/cache/mod_disk_cache.dsp @@ -53,7 +53,13 @@ BSC32=bscmake.exe # 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_disk_cache.so" /base:@..\..\os\win32\BaseAddr.ref,mod_disk_cache.so /opt:ref +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_disk_cache.so" /base:@..\..\os\win32\BaseAddr.ref,mod_disk_cache.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_disk_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_disk_cache - Win32 Debug" @@ -79,7 +85,13 @@ BSC32=bscmake.exe # 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_disk_cache.so" /base:@..\..\os\win32\BaseAddr.ref,mod_disk_cache.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_disk_cache.so" /base:@..\..\os\win32\BaseAddr.ref,mod_disk_cache.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_disk_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 diff --git a/modules/cache/mod_file_cache.dsp b/modules/cache/mod_file_cache.dsp index 984dff1e..3c6afa41 100644 --- a/modules/cache/mod_file_cache.dsp +++ b/modules/cache/mod_file_cache.dsp @@ -52,8 +52,14 @@ 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 +# 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" @@ -78,8 +84,14 @@ 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 +# 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 diff --git a/modules/cache/mod_mem_cache.c b/modules/cache/mod_mem_cache.c index ea9c45d3..65f35327 100644 --- a/modules/cache/mod_mem_cache.c +++ b/modules/cache/mod_mem_cache.c @@ -92,7 +92,7 @@ typedef struct { static mem_cache_conf *sconf; #define DEFAULT_MAX_CACHE_SIZE 100*1024 -#define DEFAULT_MIN_CACHE_OBJECT_SIZE 0 +#define DEFAULT_MIN_CACHE_OBJECT_SIZE 1 #define DEFAULT_MAX_CACHE_OBJECT_SIZE 10000 #define DEFAULT_MAX_OBJECT_CNT 1009 #define DEFAULT_MAX_STREAMING_BUFFER_SIZE 100000 @@ -539,12 +539,28 @@ static int remove_url(cache_handle_t *h, apr_pool_t *p) return OK; } +static apr_table_t *deep_table_copy(apr_pool_t *p, const apr_table_t *table) +{ + const apr_array_header_t *array = apr_table_elts(table); + apr_table_entry_t *elts = (apr_table_entry_t *) array->elts; + apr_table_t *copy = apr_table_make(p, array->nelts); + int i; + + for (i = 0; i < array->nelts; i++) { + if (elts[i].key) { + apr_table_add(copy, elts[i].key, elts[i].val); + } + } + + return copy; +} + static apr_status_t recall_headers(cache_handle_t *h, request_rec *r) { mem_cache_object_t *mobj = (mem_cache_object_t*) h->cache_obj->vobj; - h->req_hdrs = apr_table_copy(r->pool, mobj->req_hdrs); - h->resp_hdrs = apr_table_copy(r->pool, mobj->header_out); + h->req_hdrs = deep_table_copy(r->pool, mobj->req_hdrs); + h->resp_hdrs = deep_table_copy(r->pool, mobj->header_out); return OK; } @@ -585,7 +601,7 @@ static apr_status_t store_headers(cache_handle_t *h, request_rec *r, cache_info * - The original response headers (for returning with a cached response) * - The body of the message */ - mobj->req_hdrs = apr_table_copy(mobj->pool, r->headers_in); + mobj->req_hdrs = deep_table_copy(mobj->pool, r->headers_in); /* Precompute how much storage we need to hold the headers */ headers_out = ap_cache_cacheable_hdrs_out(r->pool, r->headers_out, @@ -599,7 +615,7 @@ static apr_status_t store_headers(cache_handle_t *h, request_rec *r, cache_info } headers_out = apr_table_overlay(r->pool, headers_out, r->err_headers_out); - mobj->header_out = apr_table_copy(mobj->pool, headers_out); + mobj->header_out = deep_table_copy(mobj->pool, headers_out); /* Init the info struct */ obj->info.status = info->status; @@ -863,9 +879,12 @@ static const char apr_size_t val; if (sscanf(arg, "%" APR_SIZE_T_FMT, &val) != 1) { - return "MCacheMinObjectSize value must be an integer (bytes)"; + return "MCacheMinObjectSize value must be an positive integer (bytes)"; } - sconf->min_cache_object_size = val; + if (val > 0) + sconf->min_cache_object_size = val; + else + return "MCacheMinObjectSize value must be an positive integer (bytes)"; return NULL; } static const char diff --git a/modules/cache/mod_mem_cache.dsp b/modules/cache/mod_mem_cache.dsp index 90141d9c..003e4efc 100644 --- a/modules/cache/mod_mem_cache.dsp +++ b/modules/cache/mod_mem_cache.dsp @@ -53,7 +53,13 @@ BSC32=bscmake.exe # 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_mem_cache.so" /base:@..\..\os\win32\BaseAddr.ref,mod_mem_cache.so /opt:ref +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_mem_cache.so" /base:@..\..\os\win32\BaseAddr.ref,mod_mem_cache.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_mem_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_mem_cache - Win32 Debug" @@ -79,7 +85,13 @@ BSC32=bscmake.exe # 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_mem_cache.so" /base:@..\..\os\win32\BaseAddr.ref,mod_mem_cache.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_mem_cache.so" /base:@..\..\os\win32\BaseAddr.ref,mod_mem_cache.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_mem_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 diff --git a/modules/database/NWGNUmakefile b/modules/database/NWGNUmakefile index eaff833e..a418f122 100644 --- a/modules/database/NWGNUmakefile +++ b/modules/database/NWGNUmakefile @@ -36,7 +36,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -66,7 +65,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -80,7 +79,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -102,7 +101,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = moddbd +NLM_NAME = moddbd # # This is used by the link '-desc ' directive. @@ -120,7 +119,7 @@ NLM_THREAD_NAME = DBD Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -146,14 +145,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -181,7 +180,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -228,13 +227,13 @@ FILES_nlm_exports = \ ap_dbd_cacquire \ ap_dbd_prepare \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -249,7 +248,7 @@ nlms :: libs $(TARGET_nlm) # correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) # install :: nlms FORCE - copy $(OBJDIR)\*.nlm $(INSTALL)\Apache2\modules\*.* + copy $(OBJDIR)\*.nlm $(INSTALL)\$(BASEDIR)\modules\*.* # # Any specialized rules here @@ -263,4 +262,3 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc - diff --git a/modules/database/mod_dbd.c b/modules/database/mod_dbd.c index 4df4f4b6..9914875c 100644 --- a/modules/database/mod_dbd.c +++ b/modules/database/mod_dbd.c @@ -20,15 +20,21 @@ * http://apache.webthing.com/database/ */ -#include <ctype.h> +#include "apr_reslist.h" +#include "apr_strings.h" +#include "apr_hash.h" +#include "apr_tables.h" +#include "apr_lib.h" +#include "apr_dbd.h" + +#define APR_WANT_MEMFUNC +#define APR_WANT_STRFUNC +#include "apr_want.h" #include "http_protocol.h" #include "http_config.h" #include "http_log.h" #include "http_request.h" -#include "apr_reslist.h" -#include "apr_strings.h" -#include "apr_dbd.h" #include "mod_dbd.h" extern module AP_MODULE_DECLARE_DATA dbd_module; @@ -40,126 +46,199 @@ extern module AP_MODULE_DECLARE_DATA dbd_module; #define NMAX_SET 0x4 #define EXPTIME_SET 0x8 -typedef struct dbd_prepared { - const char *label; - const char *query; - struct dbd_prepared *next; -} dbd_prepared; -typedef struct svr_cfg { +typedef struct { + server_rec *server; const char *name; const char *params; int persist; - dbd_prepared *prepared; #if APR_HAS_THREADS - apr_thread_mutex_t *mutex; - apr_pool_t *pool; - apr_reslist_t *dbpool; int nmin; int nkeep; int nmax; int exptime; + int set; +#endif + apr_hash_t *queries; +} dbd_cfg_t; + +typedef struct dbd_group_t dbd_group_t; + +struct dbd_group_t { + dbd_cfg_t *cfg; + dbd_group_t *next; + apr_pool_t *pool; +#if APR_HAS_THREADS + apr_thread_mutex_t *mutex; + apr_reslist_t *reslist; + int destroyed; #else - ap_dbd_t *conn; + ap_dbd_t *rec; #endif - unsigned int set; +}; + +typedef struct { + dbd_cfg_t *cfg; + dbd_group_t *group; } svr_cfg; typedef enum { cmd_name, cmd_params, cmd_persist, cmd_min, cmd_keep, cmd_max, cmd_exp } cmd_parts; -static apr_hash_t *dbd_prepared_defns; +static apr_pool_t *config_pool; +static dbd_group_t *group_list; /* a default DBDriver value that'll generate meaningful error messages */ static const char *const no_dbdriver = "[DBDriver unset]"; -#define ISINT(val) \ - for (p = val; *p; ++p) \ - if (!isdigit(*p)) \ - return "Argument must be numeric!" -static const char *dbd_param(cmd_parms *cmd, void *cfg, const char *val) +/* A default nmin of >0 will help with generating meaningful + * startup error messages if the database is down. + */ +#define DEFAULT_NMIN 1 +#define DEFAULT_NKEEP 2 +#define DEFAULT_NMAX 10 +#define DEFAULT_EXPTIME 300 + +static void *create_dbd_config(apr_pool_t *pool, server_rec *s) +{ + svr_cfg *svr = apr_pcalloc(pool, sizeof(svr_cfg)); + dbd_cfg_t *cfg = svr->cfg = apr_pcalloc(pool, sizeof(dbd_cfg_t)); + + cfg->server = s; + cfg->name = no_dbdriver; /* to generate meaningful error messages */ + cfg->params = ""; /* don't risk segfault on misconfiguration */ + cfg->persist = -1; +#if APR_HAS_THREADS + cfg->nmin = DEFAULT_NMIN; + cfg->nkeep = DEFAULT_NKEEP; + cfg->nmax = DEFAULT_NMAX; + cfg->exptime = DEFAULT_EXPTIME; +#endif + cfg->queries = apr_hash_make(pool); + + return svr; +} + +static void *merge_dbd_config(apr_pool_t *pool, void *basev, void *addv) +{ + dbd_cfg_t *base = ((svr_cfg*) basev)->cfg; + dbd_cfg_t *add = ((svr_cfg*) addv)->cfg; + svr_cfg *svr = apr_pcalloc(pool, sizeof(svr_cfg)); + dbd_cfg_t *new = svr->cfg = apr_pcalloc(pool, sizeof(dbd_cfg_t)); + + new->server = add->server; + new->name = (add->name != no_dbdriver) ? add->name : base->name; + new->params = strcmp(add->params, "") ? add->params : base->params; + new->persist = (add->persist != -1) ? add->persist : base->persist; +#if APR_HAS_THREADS + new->nmin = (add->set&NMIN_SET) ? add->nmin : base->nmin; + new->nkeep = (add->set&NKEEP_SET) ? add->nkeep : base->nkeep; + new->nmax = (add->set&NMAX_SET) ? add->nmax : base->nmax; + new->exptime = (add->set&EXPTIME_SET) ? add->exptime : base->exptime; +#endif + new->queries = apr_hash_overlay(pool, add->queries, base->queries); + + return svr; +} + +#define ISINT(val) do { \ + const char *p; \ + \ + for (p = val; *p; ++p) { \ + if (!apr_isdigit(*p)) { \ + return "Argument must be numeric!"; \ + } \ + } \ + } while (0) + +static const char *dbd_param(cmd_parms *cmd, void *dconf, const char *val) { - const char *p; const apr_dbd_driver_t *driver = NULL; - svr_cfg *svr = (svr_cfg*) ap_get_module_config - (cmd->server->module_config, &dbd_module); + svr_cfg *svr = ap_get_module_config(cmd->server->module_config, + &dbd_module); + dbd_cfg_t *cfg = svr->cfg; switch ((long) cmd->info) { case cmd_name: - svr->name = val; + cfg->name = val; /* loading the driver involves once-only dlloading that is * best done at server startup. This also guarantees that * we won't return an error later. */ - switch (apr_dbd_get_driver(cmd->pool, svr->name, &driver)) { + switch (apr_dbd_get_driver(cmd->pool, cfg->name, &driver)) { case APR_ENOTIMPL: - return apr_psprintf(cmd->pool, "DBD: No driver for %s", svr->name); + return apr_psprintf(cmd->pool, "DBD: No driver for %s", cfg->name); case APR_EDSOOPEN: return apr_psprintf(cmd->pool, +#ifdef NETWARE + "DBD: Can't load driver file dbd%s.nlm", +#else "DBD: Can't load driver file apr_dbd_%s.so", - svr->name); +#endif + cfg->name); case APR_ESYMNOTFOUND: return apr_psprintf(cmd->pool, "DBD: Failed to load driver apr_dbd_%s_driver", - svr->name); + cfg->name); } break; case cmd_params: - svr->params = val; + cfg->params = val; break; #if APR_HAS_THREADS case cmd_min: ISINT(val); - svr->nmin = atoi(val); - svr->set |= NMIN_SET; + cfg->nmin = atoi(val); + cfg->set |= NMIN_SET; break; case cmd_keep: ISINT(val); - svr->nkeep = atoi(val); - svr->set |= NKEEP_SET; + cfg->nkeep = atoi(val); + cfg->set |= NKEEP_SET; break; case cmd_max: ISINT(val); - svr->nmax = atoi(val); - svr->set |= NMAX_SET; + cfg->nmax = atoi(val); + cfg->set |= NMAX_SET; break; case cmd_exp: ISINT(val); - svr->exptime = atoi(val); - svr->set |= EXPTIME_SET; + cfg->exptime = atoi(val); + cfg->set |= EXPTIME_SET; break; #endif } + return NULL; } -static const char *dbd_param_flag(cmd_parms *cmd, void *cfg, int flag) + +static const char *dbd_param_flag(cmd_parms *cmd, void *dconf, int flag) { - svr_cfg *svr = (svr_cfg*) ap_get_module_config - (cmd->server->module_config, &dbd_module); + svr_cfg *svr = ap_get_module_config(cmd->server->module_config, + &dbd_module); switch ((long) cmd->info) { case cmd_persist: - svr->persist = flag; + svr->cfg->persist = flag; break; } + return NULL; } -DBD_DECLARE_NONSTD(void) ap_dbd_prepare(server_rec *s, const char *query, - const char *label) -{ - dbd_prepared *prepared = apr_pcalloc(s->process->pool, sizeof(dbd_prepared)); - const char *key = apr_psprintf(s->process->pool, "%pp", s); - prepared->label = label; - prepared->query = query; - prepared->next = apr_hash_get(dbd_prepared_defns, key, APR_HASH_KEY_STRING); - apr_hash_set(dbd_prepared_defns, key, APR_HASH_KEY_STRING, prepared); -} -static const char *dbd_prepare(cmd_parms *cmd, void *cfg, const char *query, + +static const char *dbd_prepare(cmd_parms *cmd, void *dconf, const char *query, const char *label) { + if (!label) { + label = query; + query = ""; + } + ap_dbd_prepare(cmd->server, query, label); + return NULL; } + static const command_rec dbd_cmds[] = { AP_INIT_TAKE1("DBDriver", dbd_param, (void*)cmd_name, RSRC_CONF, "SQL Driver"), @@ -167,8 +246,9 @@ static const command_rec dbd_cmds[] = { "SQL Driver Params"), AP_INIT_FLAG("DBDPersist", dbd_param_flag, (void*)cmd_persist, RSRC_CONF, "Use persistent connection/pool"), - AP_INIT_TAKE2("DBDPrepareSQL", dbd_prepare, NULL, RSRC_CONF, - "Prepared SQL statement, label"), + AP_INIT_TAKE12("DBDPrepareSQL", dbd_prepare, NULL, RSRC_CONF, + "SQL statement to prepare (or nothing, to override " + "statement inherited from main server) and label"), #if APR_HAS_THREADS AP_INIT_TAKE1("DBDMin", dbd_param, (void*)cmd_min, RSRC_CONF, "Minimum number of connections"), @@ -183,370 +263,542 @@ static const command_rec dbd_cmds[] = { #endif {NULL} }; -static void *dbd_merge(apr_pool_t *pool, void *BASE, void *ADD) { - svr_cfg *base = (svr_cfg*) BASE; - svr_cfg *add = (svr_cfg*) ADD; - svr_cfg *cfg = apr_pcalloc(pool, sizeof(svr_cfg)); - cfg->name = (add->name != no_dbdriver) ? add->name : base->name; - cfg->params = strcmp(add->params, "") ? add->params : base->params; - cfg->persist = (add->persist == -1) ? base->persist : add->persist; -#if APR_HAS_THREADS - cfg->nmin = (add->set&NMIN_SET) ? add->nmin : base->nmin; - cfg->nkeep = (add->set&NKEEP_SET) ? add->nkeep : base->nkeep; - cfg->nmax = (add->set&NMAX_SET) ? add->nmax : base->nmax; - cfg->exptime = (add->set&EXPTIME_SET) ? add->exptime : base->exptime; -#endif - cfg->set = add->set | base->set; - cfg->prepared = (add->prepared != NULL) ? add->prepared : base->prepared; - return (void*) cfg; + +static int dbd_pre_config(apr_pool_t *pconf, apr_pool_t *plog, + apr_pool_t *ptemp) +{ + config_pool = pconf; + group_list = NULL; + return OK; } -/* A default nmin of >0 will help with generating meaningful - * startup error messages if the database is down. - */ -#define DEFAULT_NMIN 1 -#define DEFAULT_NKEEP 2 -#define DEFAULT_NMAX 10 -#define DEFAULT_EXPTIME 300 -static void *dbd_cfg(apr_pool_t *p, server_rec *x) + +DBD_DECLARE_NONSTD(void) ap_dbd_prepare(server_rec *s, const char *query, + const char *label) +{ + svr_cfg *svr; + + svr = ap_get_module_config(s->module_config, &dbd_module); + if (!svr) { + /* some modules may call from within config directive handlers, and + * if these are called in a server context that contains no mod_dbd + * config directives, then we have to create our own server config + */ + svr = create_dbd_config(config_pool, s); + ap_set_module_config(s->module_config, &dbd_module, svr); + } + + if (apr_hash_get(svr->cfg->queries, label, APR_HASH_KEY_STRING) + && strcmp(query, "")) { + ap_log_error(APLOG_MARK, APLOG_WARNING, 0, s, + "conflicting SQL statements with label %s", label); + } + + apr_hash_set(svr->cfg->queries, label, APR_HASH_KEY_STRING, query); +} + +typedef struct { + const char *label, *query; +} dbd_query_t; + +static int dbd_post_config(apr_pool_t *pconf, apr_pool_t *plog, + apr_pool_t *ptemp, server_rec *s) { - svr_cfg *svr = (svr_cfg*) apr_pcalloc(p, sizeof(svr_cfg)); - svr->params = ""; /* don't risk segfault on misconfiguration */ - svr->name = no_dbdriver; /* to generate meaningful error messages */ - svr->persist = -1; + server_rec *sp; + apr_array_header_t *add_queries = apr_array_make(ptemp, 10, + sizeof(dbd_query_t)); + + for (sp = s; sp; sp = sp->next) { + svr_cfg *svr = ap_get_module_config(sp->module_config, &dbd_module); + dbd_cfg_t *cfg = svr->cfg; + apr_hash_index_t *hi_first = apr_hash_first(ptemp, cfg->queries); + dbd_group_t *group; + + /* dbd_setup in 2.2.3 and under was causing spurious error messages + * when dbd isn't configured. We can stop that with a quick check here + * together with a similar check in ap_dbd_open (where being + * unconfigured is a genuine error that must be reported). + */ + if (cfg->name == no_dbdriver || !cfg->persist) { + continue; + } + + for (group = group_list; group; group = group->next) { + dbd_cfg_t *group_cfg = group->cfg; + apr_hash_index_t *hi; + int group_ok = 1; + + if (strcmp(cfg->name, group_cfg->name) + || strcmp(cfg->params, group_cfg->params)) { + continue; + } + #if APR_HAS_THREADS - svr->nmin = DEFAULT_NMIN; - svr->nkeep = DEFAULT_NKEEP; - svr->nmax = DEFAULT_NMAX; - svr->exptime = DEFAULT_EXPTIME; + if (cfg->nmin != group_cfg->nmin + || cfg->nkeep != group_cfg->nkeep + || cfg->nmax != group_cfg->nmax + || cfg->exptime != group_cfg->exptime) { + continue; + } #endif - return svr; + + add_queries->nelts = 0; + + for (hi = hi_first; hi; hi = apr_hash_next(hi)) { + const char *label, *query; + const char *group_query; + + apr_hash_this(hi, (void*) &label, NULL, (void*) &query); + + group_query = apr_hash_get(group_cfg->queries, label, + APR_HASH_KEY_STRING); + + if (!group_query) { + dbd_query_t *add_query = apr_array_push(add_queries); + + add_query->label = label; + add_query->query = query; + } + else if (strcmp(query, group_query)) { + group_ok = 0; + break; + } + } + + if (group_ok) { + int i; + + for (i = 0; i < add_queries->nelts; ++i) { + dbd_query_t *add_query = ((dbd_query_t*) add_queries->elts) + + i; + + apr_hash_set(group_cfg->queries, add_query->label, + APR_HASH_KEY_STRING, add_query->query); + } + + svr->group = group; + break; + } + } + + if (!svr->group) { + svr->group = group = apr_pcalloc(pconf, sizeof(dbd_group_t)); + + group->cfg = cfg; + + group->next = group_list; + group_list = group; + } + } + + return OK; } -static apr_status_t dbd_prepared_init(apr_pool_t *pool, svr_cfg *svr, - ap_dbd_t *dbd) + +static apr_status_t dbd_prepared_init(apr_pool_t *pool, dbd_cfg_t *cfg, + ap_dbd_t *rec) { - dbd_prepared *p; - apr_status_t ret = APR_SUCCESS; - apr_dbd_prepared_t *stmt; - dbd->prepared = apr_hash_make(pool); + apr_hash_index_t *hi; + apr_status_t rv = APR_SUCCESS; + + rec->prepared = apr_hash_make(pool); + + for (hi = apr_hash_first(pool, cfg->queries); hi; + hi = apr_hash_next(hi)) { + const char *label, *query; + apr_dbd_prepared_t *stmt; + + apr_hash_this(hi, (void*) &label, NULL, (void*) &query); + + if (!strcmp(query, "")) { + continue; + } - for (p = svr->prepared; p; p = p->next) { stmt = NULL; - if (apr_dbd_prepare(dbd->driver, pool, dbd->handle, p->query, - p->label, &stmt) == 0) { - apr_hash_set(dbd->prepared, p->label, APR_HASH_KEY_STRING, stmt); + if (apr_dbd_prepare(rec->driver, pool, rec->handle, query, + label, &stmt)) { + rv = APR_EGENERAL; } else { - ret = APR_EGENERAL; + apr_hash_set(rec->prepared, label, APR_HASH_KEY_STRING, stmt); } } - return ret; + + return rv; } -/************ svr cfg: manage db connection pool ****************/ + +static apr_status_t dbd_close(void *data) +{ + ap_dbd_t *rec = data; + + return apr_dbd_close(rec->driver, rec->handle); +} + +#if APR_HAS_THREADS +static apr_status_t dbd_destruct(void *data, void *params, apr_pool_t *pool) +{ + dbd_group_t *group = params; + + if (!group->destroyed) { + ap_dbd_t *rec = data; + + apr_pool_destroy(rec->pool); + } + + return APR_SUCCESS; +} +#endif + /* an apr_reslist_constructor for SQL connections * Also use this for opening in non-reslist modes, since it gives * us all the error-handling in one place. */ -static apr_status_t dbd_construct(void **db, void *params, apr_pool_t *pool) +static apr_status_t dbd_construct(void **data_ptr, + void *params, apr_pool_t *pool) { - svr_cfg *svr = (svr_cfg*) params; - ap_dbd_t *rec = apr_pcalloc(pool, sizeof(ap_dbd_t)); + dbd_group_t *group = params; + dbd_cfg_t *cfg = group->cfg; + apr_pool_t *rec_pool, *prepared_pool; + ap_dbd_t *rec; apr_status_t rv; - /* this pool is mostly so dbd_close can destroy the prepared stmts */ - rv = apr_pool_create(&rec->pool, pool); + rv = apr_pool_create(&rec_pool, pool); if (rv != APR_SUCCESS) { - ap_log_perror(APLOG_MARK, APLOG_CRIT, rv, pool, - "DBD: Failed to create memory pool"); + ap_log_error(APLOG_MARK, APLOG_CRIT, rv, cfg->server, + "DBD: Failed to create memory pool"); + return rv; } -/* The driver is loaded at config time now, so this just checks a hash. - * If that changes, the driver DSO could be registered to unload against - * our pool, which is probably not what we want. Error checking isn't - * necessary now, but in case that changes in the future ... - */ - rv = apr_dbd_get_driver(rec->pool, svr->name, &rec->driver); - switch (rv) { - case APR_ENOTIMPL: - ap_log_perror(APLOG_MARK, APLOG_CRIT, rv, rec->pool, - "DBD: driver for %s not available", svr->name); - return rv; - case APR_EDSOOPEN: - ap_log_perror(APLOG_MARK, APLOG_CRIT, rv, rec->pool, - "DBD: can't find driver for %s", svr->name); - return rv; - case APR_ESYMNOTFOUND: - ap_log_perror(APLOG_MARK, APLOG_CRIT, rv, rec->pool, - "DBD: driver for %s is invalid or corrupted", svr->name); - return rv; - default: - ap_log_perror(APLOG_MARK, APLOG_CRIT, rv, rec->pool, - "DBD: mod_dbd not compatible with apr in get_driver"); + rec = apr_pcalloc(rec_pool, sizeof(ap_dbd_t)); + + rec->pool = rec_pool; + + /* The driver is loaded at config time now, so this just checks a hash. + * If that changes, the driver DSO could be registered to unload against + * our pool, which is probably not what we want. Error checking isn't + * necessary now, but in case that changes in the future ... + */ + rv = apr_dbd_get_driver(rec->pool, cfg->name, &rec->driver); + if (rv != APR_SUCCESS) { + switch (rv) { + case APR_ENOTIMPL: + ap_log_error(APLOG_MARK, APLOG_ERR, rv, cfg->server, + "DBD: driver for %s not available", cfg->name); + break; + case APR_EDSOOPEN: + ap_log_error(APLOG_MARK, APLOG_ERR, rv, cfg->server, + "DBD: can't find driver for %s", cfg->name); + break; + case APR_ESYMNOTFOUND: + ap_log_error(APLOG_MARK, APLOG_ERR, rv, cfg->server, + "DBD: driver for %s is invalid or corrupted", + cfg->name); + break; + default: + ap_log_error(APLOG_MARK, APLOG_ERR, rv, cfg->server, + "DBD: mod_dbd not compatible with APR in get_driver"); + break; + } + + apr_pool_destroy(rec->pool); return rv; - case APR_SUCCESS: - break; } - rv = apr_dbd_open(rec->driver, rec->pool, svr->params, &rec->handle); - switch (rv) { - case APR_EGENERAL: - ap_log_perror(APLOG_MARK, APLOG_CRIT, rv, rec->pool, - "DBD: Can't connect to %s", svr->name); + rv = apr_dbd_open(rec->driver, rec->pool, cfg->params, &rec->handle); + if (rv != APR_SUCCESS) { + switch (rv) { + case APR_EGENERAL: + ap_log_error(APLOG_MARK, APLOG_ERR, rv, cfg->server, + "DBD: Can't connect to %s", cfg->name); + break; + default: + ap_log_error(APLOG_MARK, APLOG_ERR, rv, cfg->server, + "DBD: mod_dbd not compatible with APR in open"); + break; + } + + apr_pool_destroy(rec->pool); return rv; - default: - ap_log_perror(APLOG_MARK, APLOG_CRIT, rv, rec->pool, - "DBD: mod_dbd not compatible with apr in open"); + } + + apr_pool_cleanup_register(rec->pool, rec, dbd_close, + apr_pool_cleanup_null); + + /* we use a sub-pool for the prepared statements for each connection so + * that they will be cleaned up first, before the connection is closed + */ + rv = apr_pool_create(&prepared_pool, rec->pool); + if (rv != APR_SUCCESS) { + ap_log_error(APLOG_MARK, APLOG_CRIT, rv, cfg->server, + "DBD: Failed to create memory pool"); + + apr_pool_destroy(rec->pool); return rv; - case APR_SUCCESS: - break; } - *db = rec; - rv = dbd_prepared_init(rec->pool, svr, rec); + + rv = dbd_prepared_init(prepared_pool, cfg, rec); if (rv != APR_SUCCESS) { const char *errmsg = apr_dbd_error(rec->driver, rec->handle, rv); - ap_log_perror(APLOG_MARK, APLOG_CRIT, rv, rec->pool, - "DBD: failed to initialise prepared SQL statements: %s", - (errmsg ? errmsg : "[???]")); + ap_log_error(APLOG_MARK, APLOG_ERR, rv, cfg->server, + "DBD: failed to prepare SQL statements: %s", + (errmsg ? errmsg : "[???]")); + + apr_pool_destroy(rec->pool); + return rv; } - return rv; -} -static apr_status_t dbd_close(void *CONN) -{ - ap_dbd_t *conn = CONN; - apr_status_t rv = apr_dbd_close(conn->driver, conn->handle); - apr_pool_destroy(conn->pool); - return rv; + + *data_ptr = rec; + + return APR_SUCCESS; } + #if APR_HAS_THREADS -static apr_status_t dbd_destruct(void *sql, void *params, apr_pool_t *pool) +static apr_status_t dbd_destroy(void *data) { - return dbd_close(sql); + dbd_group_t *group = data; + + group->destroyed = 1; + + return APR_SUCCESS; } -static apr_status_t dbd_setup(apr_pool_t *pool, svr_cfg *svr) +static apr_status_t dbd_setup(server_rec *s, dbd_group_t *group) { + dbd_cfg_t *cfg = group->cfg; apr_status_t rv; - /* create a pool just for the reslist from a process-lifetime pool; - * that pool (s->process->pool in the dbd_setup_lock case, - * whatever was passed to ap_run_child_init in the dbd_setup_init case) - * will be shared with other threads doing other non-mod_dbd things - * so we can't use it for the reslist directly + /* We create the reslist using a sub-pool of the pool passed to our + * child_init hook. No other threads can be here because we're + * either in the child_init phase or dbd_setup_lock() acquired our mutex. + * No other threads will use this sub-pool after this, except via + * reslist calls, which have an internal mutex. + * + * We need to short-circuit the cleanup registered internally by + * apr_reslist_create(). We do this by registering dbd_destroy() + * as a cleanup afterwards, so that it will run before the reslist's + * internal cleanup. + * + * If we didn't do this, then we could free memory twice when the pool + * was destroyed. When apr_pool_destroy() runs, it first destroys all + * all the per-connection sub-pools created in dbd_construct(), and + * then it runs the reslist's cleanup. The cleanup calls dbd_destruct() + * on each resource, which would then attempt to destroy the sub-pools + * a second time. */ - rv = apr_pool_create(&svr->pool, pool); + rv = apr_reslist_create(&group->reslist, + cfg->nmin, cfg->nkeep, cfg->nmax, + apr_time_from_sec(cfg->exptime), + dbd_construct, dbd_destruct, group, + group->pool); if (rv != APR_SUCCESS) { - ap_log_perror(APLOG_MARK, APLOG_CRIT, rv, pool, - "DBD: Failed to create reslist memory pool"); + ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, + "DBD: failed to initialise"); return rv; } - rv = apr_reslist_create(&svr->dbpool, svr->nmin, svr->nkeep, svr->nmax, - apr_time_from_sec(svr->exptime), - dbd_construct, dbd_destruct, svr, svr->pool); - if (rv == APR_SUCCESS) { - apr_pool_cleanup_register(svr->pool, svr->dbpool, - (void*)apr_reslist_destroy, - apr_pool_cleanup_null); - } - else { - ap_log_perror(APLOG_MARK, APLOG_CRIT, rv, svr->pool, - "DBD: failed to initialise"); - apr_pool_destroy(svr->pool); - svr->pool = NULL; - } + apr_pool_cleanup_register(group->pool, group, dbd_destroy, + apr_pool_cleanup_null); - return rv; + return APR_SUCCESS; } +#endif + static apr_status_t dbd_setup_init(apr_pool_t *pool, server_rec *s) { - svr_cfg *svr = ap_get_module_config(s->module_config, &dbd_module); - apr_status_t rv; + dbd_group_t *group; + apr_status_t rv = APR_SUCCESS; - /* dbd_setup in 2.2.3 and under was causing spurious error messages - * when dbd isn't configured. We can stop that with a quick check here - * together with a similar check in ap_dbd_open (where being - * unconfigured is a genuine error that must be reported). - */ - if (svr->name == no_dbdriver) { - return APR_SUCCESS; - } + for (group = group_list; group; group = group->next) { + apr_status_t rv2; - if (!svr->persist) { - return APR_SUCCESS; - } + rv2 = apr_pool_create(&group->pool, pool); + if (rv2 != APR_SUCCESS) { + ap_log_error(APLOG_MARK, APLOG_CRIT, rv2, s, + "DBD: Failed to create reslist cleanup memory pool"); + return rv2; + } - rv = dbd_setup(pool, svr); - if (rv == APR_SUCCESS) { - return rv; - } +#if APR_HAS_THREADS + rv2 = dbd_setup(s, group); + if (rv2 == APR_SUCCESS) { + continue; + } + else if (rv == APR_SUCCESS) { + rv = rv2; + } - /* we failed, so create a mutex so that subsequent competing callers - * to ap_dbd_open can serialize themselves while they retry - */ - rv = apr_thread_mutex_create(&svr->mutex, APR_THREAD_MUTEX_DEFAULT, pool); - if (rv != APR_SUCCESS) { - ap_log_perror(APLOG_MARK, APLOG_CRIT, rv, pool, - "DBD: Failed to create thread mutex"); + /* we failed, so create a mutex so that subsequent competing callers + * to ap_dbd_open can serialize themselves while they retry + */ + rv2 = apr_thread_mutex_create(&group->mutex, + APR_THREAD_MUTEX_DEFAULT, pool); + if (rv2 != APR_SUCCESS) { + ap_log_error(APLOG_MARK, APLOG_CRIT, rv2, s, + "DBD: Failed to create thread mutex"); + return rv2; + } +#endif } + return rv; } -static apr_status_t dbd_setup_lock(apr_pool_t *pool, server_rec *s) + +#if APR_HAS_THREADS +static apr_status_t dbd_setup_lock(server_rec *s, dbd_group_t *group) { - svr_cfg *svr = ap_get_module_config(s->module_config, &dbd_module); - apr_status_t rv, rv2 = APR_SUCCESS; + apr_status_t rv = APR_SUCCESS, rv2; /* several threads could be here at the same time, all trying to * initialize the reslist because dbd_setup_init failed to do so */ - if (!svr->mutex) { + if (!group->mutex) { /* we already logged an error when the mutex couldn't be created */ return APR_EGENERAL; } - rv = apr_thread_mutex_lock(svr->mutex); - if (rv != APR_SUCCESS) { - ap_log_perror(APLOG_MARK, APLOG_CRIT, rv, pool, - "DBD: Failed to acquire thread mutex"); - return rv; + rv2 = apr_thread_mutex_lock(group->mutex); + if (rv2 != APR_SUCCESS) { + ap_log_error(APLOG_MARK, APLOG_ERR, rv2, s, + "DBD: Failed to acquire thread mutex"); + return rv2; } - if (!svr->dbpool) { - rv2 = dbd_setup(s->process->pool, svr); + if (!group->reslist) { + rv = dbd_setup(s, group); } - rv = apr_thread_mutex_unlock(svr->mutex); - if (rv != APR_SUCCESS) { - ap_log_perror(APLOG_MARK, APLOG_CRIT, rv, pool, - "DBD: Failed to release thread mutex"); - if (rv2 == APR_SUCCESS) { - rv2 = rv; + rv2 = apr_thread_mutex_unlock(group->mutex); + if (rv2 != APR_SUCCESS) { + ap_log_error(APLOG_MARK, APLOG_ERR, rv2, s, + "DBD: Failed to release thread mutex"); + if (rv == APR_SUCCESS) { + rv = rv2; } } - return rv2; + + return rv; } #endif - /* Functions we export for modules to use: - open acquires a connection from the pool (opens one if necessary) - close releases it back in to the pool */ -DBD_DECLARE_NONSTD(void) ap_dbd_close(server_rec *s, ap_dbd_t *sql) +DBD_DECLARE_NONSTD(void) ap_dbd_close(server_rec *s, ap_dbd_t *rec) { svr_cfg *svr = ap_get_module_config(s->module_config, &dbd_module); - if (!svr->persist) { - dbd_close((void*) sql); + + if (!svr->cfg->persist) { + apr_pool_destroy(rec->pool); } #if APR_HAS_THREADS else { - apr_reslist_release(svr->dbpool, sql); + apr_reslist_release(svr->group->reslist, rec); } #endif } -#define arec ((ap_dbd_t*)rec) -#if APR_HAS_THREADS + +static apr_status_t dbd_check(apr_pool_t *pool, server_rec *s, ap_dbd_t *rec) +{ + svr_cfg *svr; + apr_status_t rv = apr_dbd_check_conn(rec->driver, pool, rec->handle); + const char *errmsg; + + if ((rv == APR_SUCCESS) || (rv == APR_ENOTIMPL)) { + return APR_SUCCESS; + } + + errmsg = apr_dbd_error(rec->driver, rec->handle, rv); + if (!errmsg) { + errmsg = "(unknown)"; + } + + svr = ap_get_module_config(s->module_config, &dbd_module); + ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, + "DBD [%s] Error: %s", svr->cfg->name, errmsg); + return rv; +} + DBD_DECLARE_NONSTD(ap_dbd_t*) ap_dbd_open(apr_pool_t *pool, server_rec *s) { - void *rec = NULL; svr_cfg *svr = ap_get_module_config(s->module_config, &dbd_module); - apr_status_t rv = APR_SUCCESS; - const char *errmsg; + dbd_group_t *group = svr->group; + dbd_cfg_t *cfg = svr->cfg; + ap_dbd_t *rec = NULL; +#if APR_HAS_THREADS + apr_status_t rv; +#endif /* If nothing is configured, we shouldn't be here */ - if (svr->name == no_dbdriver) { - ap_log_perror(APLOG_MARK, APLOG_ERR, 0, pool, "DBD: not configured"); + if (cfg->name == no_dbdriver) { + ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, "DBD: not configured"); return NULL; } - if (!svr->persist) { + if (!cfg->persist) { /* Return a once-only connection */ - rv = dbd_construct(&rec, svr, s->process->pool); - return (rv == APR_SUCCESS) ? arec : NULL; + group = apr_pcalloc(pool, sizeof(dbd_group_t)); + + group->cfg = cfg; + + dbd_construct((void*) &rec, group, pool); + return rec; } - if (!svr->dbpool) { - if (dbd_setup_lock(pool, s) != APR_SUCCESS) { +#if APR_HAS_THREADS + if (!group->reslist) { + if (dbd_setup_lock(s, group) != APR_SUCCESS) { return NULL; } } - rv = apr_reslist_acquire(svr->dbpool, &rec); + + rv = apr_reslist_acquire(group->reslist, (void*) &rec); if (rv != APR_SUCCESS) { - ap_log_perror(APLOG_MARK, APLOG_ERR, rv, pool, - "Failed to acquire DBD connection from pool!"); + ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, + "Failed to acquire DBD connection from pool!"); return NULL; } - rv = apr_dbd_check_conn(arec->driver, pool, arec->handle); - if ((rv != APR_SUCCESS) && (rv != APR_ENOTIMPL)) { - errmsg = apr_dbd_error(arec->driver, arec->handle, rv); - if (!errmsg) { - errmsg = "(unknown)"; - } - ap_log_perror(APLOG_MARK, APLOG_ERR, rv, pool, - "DBD[%s] Error: %s", svr->name, errmsg ); - apr_reslist_invalidate(svr->dbpool, rec); - return NULL; - } - return arec; -} -#else -DBD_DECLARE_NONSTD(ap_dbd_t*) ap_dbd_open(apr_pool_t *pool, server_rec *s) -{ - apr_status_t rv = APR_SUCCESS; - const char *errmsg; - void *rec = NULL; - svr_cfg *svr = ap_get_module_config(s->module_config, &dbd_module); - /* If nothing is configured, we shouldn't be here */ - if (svr->name == no_dbdriver) { - ap_log_perror(APLOG_MARK, APLOG_ERR, 0, pool, "DBD: not configured"); + if (dbd_check(pool, s, rec) != APR_SUCCESS) { + apr_reslist_invalidate(group->reslist, rec); return NULL; } - - if (!svr->persist) { - /* Return a once-only connection */ - rv = dbd_construct(&rec, svr, s->process->pool); - return (rv == APR_SUCCESS) ? arec : NULL; - } - -/* since we're in nothread-land, we can mess with svr->conn with impunity */ -/* If we have a persistent connection and it's good, we'll use it */ - if (svr->conn) { - rv = apr_dbd_check_conn(svr->conn->driver, pool, svr->conn->handle); - if ((rv != APR_SUCCESS) && (rv != APR_ENOTIMPL)) { - errmsg = apr_dbd_error(arec->driver, arec->handle, rv); - if (!errmsg) { - errmsg = "(unknown)"; - } - ap_log_perror(APLOG_MARK, APLOG_ERR, rv, pool, - "DBD[%s] Error: %s", svr->name, errmsg); - svr->conn = NULL; +#else + /* If we have a persistent connection and it's good, we'll use it; + * since this is non-threaded, we can update without a mutex + */ + rec = group->rec; + if (rec) { + if (dbd_check(pool, s, rec) != APR_SUCCESS) { + apr_pool_destroy(rec->pool); + rec = NULL; } } -/* We don't have a connection right now, so we'll open one */ - if (!svr->conn) { - if (dbd_construct(&rec, svr, s->process->pool) == APR_SUCCESS) { - svr->conn = arec ; - apr_pool_cleanup_register(s->process->pool, svr->conn, - dbd_close, apr_pool_cleanup_null); - } + + /* We don't have a connection right now, so we'll open one */ + if (!rec) { + dbd_construct((void*) &rec, group, group->pool); + group->rec = rec; } - return svr->conn; -} #endif + + return rec; +} + #if APR_HAS_THREADS typedef struct { - ap_dbd_t *conn; - apr_reslist_t *dbpool; -} dbd_pool_rec; -static apr_status_t dbd_release(void *REQ) + ap_dbd_t *rec; + apr_reslist_t *reslist; +} dbd_acquire_t; + +static apr_status_t dbd_release(void *data) { - dbd_pool_rec *req = REQ; - apr_reslist_release(req->dbpool, req->conn); + dbd_acquire_t *acq = data; + apr_reslist_release(acq->reslist, acq->rec); return APR_SUCCESS; } + DBD_DECLARE_NONSTD(ap_dbd_t *) ap_dbd_acquire(request_rec *r) { - svr_cfg *svr; - dbd_pool_rec *req; + dbd_acquire_t *acq; while (!ap_is_initial_req(r)) { if (r->prev) { @@ -557,54 +809,52 @@ DBD_DECLARE_NONSTD(ap_dbd_t *) ap_dbd_acquire(request_rec *r) } } - req = ap_get_module_config(r->request_config, &dbd_module); - if (!req) { - req = apr_palloc(r->pool, sizeof(dbd_pool_rec)); - req->conn = ap_dbd_open(r->pool, r->server); - if (req->conn) { - svr = ap_get_module_config(r->server->module_config, &dbd_module); - ap_set_module_config(r->request_config, &dbd_module, req); - if (svr->persist) { - req->dbpool = svr->dbpool; - apr_pool_cleanup_register(r->pool, req, dbd_release, - apr_pool_cleanup_null); - } - else { - apr_pool_cleanup_register(r->pool, req->conn, dbd_close, + acq = ap_get_module_config(r->request_config, &dbd_module); + if (!acq) { + acq = apr_palloc(r->pool, sizeof(dbd_acquire_t)); + acq->rec = ap_dbd_open(r->pool, r->server); + if (acq->rec) { + svr_cfg *svr = ap_get_module_config(r->server->module_config, + &dbd_module); + + ap_set_module_config(r->request_config, &dbd_module, acq); + if (svr->cfg->persist) { + acq->reslist = svr->group->reslist; + apr_pool_cleanup_register(r->pool, acq, dbd_release, apr_pool_cleanup_null); } } } - return req->conn; + + return acq->rec; } + DBD_DECLARE_NONSTD(ap_dbd_t *) ap_dbd_cacquire(conn_rec *c) { - svr_cfg *svr; - dbd_pool_rec *req = ap_get_module_config(c->conn_config, &dbd_module); - if (!req) { - req = apr_palloc(c->pool, sizeof(dbd_pool_rec)); - req->conn = ap_dbd_open(c->pool, c->base_server); - if (req->conn) { - svr = ap_get_module_config(c->base_server->module_config, &dbd_module); - ap_set_module_config(c->conn_config, &dbd_module, req); - if (svr->persist) { - req->dbpool = svr->dbpool; - apr_pool_cleanup_register(c->pool, req, dbd_release, - apr_pool_cleanup_null); - } - else { - apr_pool_cleanup_register(c->pool, req->conn, dbd_close, + dbd_acquire_t *acq = ap_get_module_config(c->conn_config, &dbd_module); + + if (!acq) { + acq = apr_palloc(c->pool, sizeof(dbd_acquire_t)); + acq->rec = ap_dbd_open(c->pool, c->base_server); + if (acq->rec) { + svr_cfg *svr = ap_get_module_config(c->base_server->module_config, + &dbd_module); + + ap_set_module_config(c->conn_config, &dbd_module, acq); + if (svr->cfg->persist) { + acq->reslist = svr->group->reslist; + apr_pool_cleanup_register(c->pool, acq, dbd_release, apr_pool_cleanup_null); } } } - return req->conn; + + return acq->rec; } #else DBD_DECLARE_NONSTD(ap_dbd_t *) ap_dbd_acquire(request_rec *r) { - svr_cfg *svr; - ap_dbd_t *ret; + ap_dbd_t *rec; while (!ap_is_initial_req(r)) { if (r->prev) { @@ -615,80 +865,54 @@ DBD_DECLARE_NONSTD(ap_dbd_t *) ap_dbd_acquire(request_rec *r) } } - ret = ap_get_module_config(r->request_config, &dbd_module); - if (!ret) { - svr = ap_get_module_config(r->server->module_config, &dbd_module); - ret = ap_dbd_open(r->pool, r->server); - if (ret) { - ap_set_module_config(r->request_config, &dbd_module, ret); - if (!svr->persist) { - apr_pool_cleanup_register(r->pool, svr->conn, dbd_close, - apr_pool_cleanup_null); - } - /* if persist then dbd_open registered cleanup on proc pool */ + rec = ap_get_module_config(r->request_config, &dbd_module); + if (!rec) { + rec = ap_dbd_open(r->pool, r->server); + if (rec) { + ap_set_module_config(r->request_config, &dbd_module, rec); } } - return ret; + + return rec; } + DBD_DECLARE_NONSTD(ap_dbd_t *) ap_dbd_cacquire(conn_rec *c) { - svr_cfg *svr; - ap_dbd_t *ret = ap_get_module_config(c->conn_config, &dbd_module); - if (!ret) { - svr = ap_get_module_config(c->base_server->module_config, &dbd_module); - ret = ap_dbd_open(c->pool, c->base_server); - if (ret) { - ap_set_module_config(c->conn_config, &dbd_module, ret); - if (!svr->persist) { - apr_pool_cleanup_register(c->pool, svr->conn, dbd_close, - apr_pool_cleanup_null); - } - /* if persist then dbd_open registered cleanup on proc pool */ + ap_dbd_t *rec = ap_get_module_config(c->conn_config, &dbd_module); + + if (!rec) { + rec = ap_dbd_open(c->pool, c->base_server); + if (rec) { + ap_set_module_config(c->conn_config, &dbd_module, rec); } } - return ret; + + return rec; } #endif -static int dbd_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp) -{ - dbd_prepared_defns = apr_hash_make(ptemp); - return OK; -} -static int dbd_post_config(apr_pool_t *pconf, apr_pool_t *plog, - apr_pool_t *ptemp, server_rec *s) -{ - svr_cfg *svr; - server_rec *sp; - for (sp = s; sp; sp = sp->next) { - const char *key = apr_psprintf(s->process->pool, "%pp", s); - svr = ap_get_module_config(sp->module_config, &dbd_module); - svr->prepared = apr_hash_get(dbd_prepared_defns, key, - APR_HASH_KEY_STRING); - } - return OK; -} static void dbd_hooks(apr_pool_t *pool) { -#if APR_HAS_THREADS + ap_hook_pre_config(dbd_pre_config, NULL, NULL, APR_HOOK_MIDDLE); + ap_hook_post_config(dbd_post_config, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_child_init((void*)dbd_setup_init, NULL, NULL, APR_HOOK_MIDDLE); -#endif + + APR_REGISTER_OPTIONAL_FN(ap_dbd_prepare); APR_REGISTER_OPTIONAL_FN(ap_dbd_open); APR_REGISTER_OPTIONAL_FN(ap_dbd_close); APR_REGISTER_OPTIONAL_FN(ap_dbd_acquire); APR_REGISTER_OPTIONAL_FN(ap_dbd_cacquire); - APR_REGISTER_OPTIONAL_FN(ap_dbd_prepare); + apr_dbd_init(pool); - ap_hook_pre_config(dbd_pre_config, NULL, NULL, APR_HOOK_MIDDLE); - ap_hook_post_config(dbd_post_config, NULL, NULL, APR_HOOK_MIDDLE); } module AP_MODULE_DECLARE_DATA dbd_module = { STANDARD20_MODULE_STUFF, NULL, NULL, - dbd_cfg, - dbd_merge, + create_dbd_config, + merge_dbd_config, dbd_cmds, dbd_hooks }; + diff --git a/modules/database/mod_dbd.dsp b/modules/database/mod_dbd.dsp index 49f11c47..4fd3c8a3 100644 --- a/modules/database/mod_dbd.dsp +++ b/modules/database/mod_dbd.dsp @@ -52,8 +52,14 @@ 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_dbd.so" /base:@..\..\os\win32\BaseAddr.ref,mod_dbd.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_dbd.so" /base:@..\..\os\win32\BaseAddr.ref,mod_dbd.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_dbd.so" /base:@..\..\os\win32\BaseAddr.ref,mod_dbd.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_dbd.so" /base:@..\..\os\win32\BaseAddr.ref,mod_dbd.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_dbd.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_dbd - Win32 Debug" @@ -78,8 +84,14 @@ 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_dbd.so" /base:@..\..\os\win32\BaseAddr.ref,mod_dbd.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_dbd.so" /base:@..\..\os\win32\BaseAddr.ref,mod_dbd.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_dbd.so" /base:@..\..\os\win32\BaseAddr.ref,mod_dbd.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_dbd.so" /base:@..\..\os\win32\BaseAddr.ref,mod_dbd.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_dbd.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 diff --git a/modules/dav/fs/NWGNUmakefile b/modules/dav/fs/NWGNUmakefile index 3e596613..e9c27aea 100644 --- a/modules/dav/fs/NWGNUmakefile +++ b/modules/dav/fs/NWGNUmakefile @@ -68,7 +68,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -82,7 +82,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -104,7 +104,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = modDAVFS +NLM_NAME = modDAVFS # # This is used by the link '-desc ' directive. @@ -122,7 +122,7 @@ NLM_THREAD_NAME = modDAVFS Thread # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -148,7 +148,7 @@ NLM_CHECK_SYM = # # If this is specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # Declare all target files (you must add your files here) @@ -184,7 +184,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -234,13 +234,13 @@ endif FILES_nlm_exports = \ dav_fs_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -255,7 +255,7 @@ nlms :: libs $(TARGET_nlm) # correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) # install :: nlms FORCE - copy $(OBJDIR)\moddavfs.nlm $(INSTALL)\Apache2\modules + copy $(OBJDIR)\moddavfs.nlm $(INSTALL)\$(BASEDIR)\modules # # Any specialized rules here # @@ -270,4 +270,3 @@ vpath %.c ../../arch/netware include $(AP_WORK)\build\NWGNUtail.inc - diff --git a/modules/dav/fs/mod_dav_fs.dsp b/modules/dav/fs/mod_dav_fs.dsp index e5291c72..fbfc1e43 100644 --- a/modules/dav/fs/mod_dav_fs.dsp +++ b/modules/dav/fs/mod_dav_fs.dsp @@ -52,8 +52,14 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /out:"Release/mod_dav_fs.so" /base:@..\..\..\os\win32\BaseAddr.ref,mod_dav_fs.so -# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_dav_fs.so" /base:@..\..\..\os\win32\BaseAddr.ref,mod_dav_fs.so /opt:ref +# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /out:".\Release\mod_dav_fs.so" /base:@..\..\..\os\win32\BaseAddr.ref,mod_dav_fs.so +# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_dav_fs.so" /base:@..\..\..\os\win32\BaseAddr.ref,mod_dav_fs.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_dav_fs.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_dav_fs - Win32 Debug" @@ -78,8 +84,14 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_dav_fs.so" /base:@..\..\..\os\win32\BaseAddr.ref,mod_dav_fs.so -# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_dav_fs.so" /base:@..\..\..\os\win32\BaseAddr.ref,mod_dav_fs.so +# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_dav_fs.so" /base:@..\..\..\os\win32\BaseAddr.ref,mod_dav_fs.so +# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_dav_fs.so" /base:@..\..\..\os\win32\BaseAddr.ref,mod_dav_fs.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_dav_fs.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 diff --git a/modules/dav/lock/NWGNUmakefile b/modules/dav/lock/NWGNUmakefile index 6036fab3..66e22eae 100644 --- a/modules/dav/lock/NWGNUmakefile +++ b/modules/dav/lock/NWGNUmakefile @@ -67,7 +67,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -81,7 +81,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -103,7 +103,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = modDAVLK +NLM_NAME = modDAVLK # # This is used by the link '-desc ' directive. @@ -121,7 +121,7 @@ NLM_THREAD_NAME = modDAVLK Thread # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -147,7 +147,7 @@ NLM_CHECK_SYM = # # If this is specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # Declare all target files (you must add your files here) @@ -180,7 +180,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -224,13 +224,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ dav_lock_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -245,7 +245,7 @@ nlms :: libs $(TARGET_nlm) # correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) # install :: nlms FORCE - copy $(OBJDIR)\moddavlk.nlm $(INSTALL)\Apache2\modules + copy $(OBJDIR)\moddavlk.nlm $(INSTALL)\$(BASEDIR)\modules # # Any specialized rules here # @@ -258,4 +258,3 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc - diff --git a/modules/dav/lock/mod_dav_lock.dsp b/modules/dav/lock/mod_dav_lock.dsp new file mode 100644 index 00000000..e1c1a24e --- /dev/null +++ b/modules/dav/lock/mod_dav_lock.dsp @@ -0,0 +1,127 @@ +# Microsoft Developer Studio Project File - Name="mod_dav_lock" - 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_dav_lock - Win32 Release +!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_dav_lock.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_dav_lock.mak" CFG="mod_dav_lock - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "mod_dav_lock - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "mod_dav_lock - 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_dav_lock - 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_dav_lock_src" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /fo"Release/mod_dav_lock.res" /i "../../../include" /i "../../../srclib/apr/include" /d "NDEBUG" /d BIN_NAME="mod_dav_lock.so" /d LONG_NAME="dav_lock_module for Apache" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /out:".\Release\mod_dav_lock.so" /base:@..\..\..\os\win32\BaseAddr.ref,mod_dav_lock.so +# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_dav_lock.so" /base:@..\..\..\os\win32\BaseAddr.ref,mod_dav_lock.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_dav_lock.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_dav_lock - 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_dav_lock_src" /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /fo"Debug/mod_dav_lock.res" /i "../../../include" /i "../../../srclib/apr/include" /d "_DEBUG" /d BIN_NAME="mod_dav_lock.so" /d LONG_NAME="dav_lock_module for Apache" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_dav_lock.so" /base:@..\..\..\os\win32\BaseAddr.ref,mod_dav_lock.so +# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_dav_lock.so" /base:@..\..\..\os\win32\BaseAddr.ref,mod_dav_lock.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_dav_lock.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_dav_lock - Win32 Release" +# Name "mod_dav_lock - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90" +# Begin Source File + +SOURCE=.\locks.c +# End Source File +# Begin Source File + +SOURCE=.\mod_dav_lock.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd" +# Begin Source File + +SOURCE=.\locks.h +# End Source File +# End Group +# Begin Source File + +SOURCE=..\..\..\build\win32\httpd.rc +# End Source File +# End Target +# End Project diff --git a/modules/dav/main/NWGNUmakefile b/modules/dav/main/NWGNUmakefile index 9fc46c03..c8626342 100644 --- a/modules/dav/main/NWGNUmakefile +++ b/modules/dav/main/NWGNUmakefile @@ -65,7 +65,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -79,7 +79,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -101,7 +101,7 @@ endif # 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_DAV +NLM_NAME = mod_DAV # # This is used by the link '-desc ' directive. @@ -119,7 +119,7 @@ NLM_THREAD_NAME = mod_DAV # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -145,7 +145,7 @@ NLM_CHECK_SYM = # # If this is specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # If this is specified it will be linked in with the XDCData option in the def @@ -190,7 +190,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -233,13 +233,13 @@ FILES_nlm_exports = \ dav_module \ @dav.imp \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -254,7 +254,7 @@ nlms :: libs $(TARGET_nlm) # correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) # install :: nlms FORCE - copy $(OBJDIR)\mod_dav.nlm $(INSTALL)\Apache2\modules\*.* + copy $(OBJDIR)\mod_dav.nlm $(INSTALL)\$(BASEDIR)\modules\*.* # # Any specialized rules here @@ -268,4 +268,3 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc - diff --git a/modules/dav/main/mod_dav.dsp b/modules/dav/main/mod_dav.dsp index dea4d11a..752cea89 100644 --- a/modules/dav/main/mod_dav.dsp +++ b/modules/dav/main/mod_dav.dsp @@ -52,8 +52,14 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /out:"Release/mod_dav.so" /base:@..\..\..\os\win32\BaseAddr.ref,mod_dav.so -# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_dav.so" /base:@..\..\..\os\win32\BaseAddr.ref,mod_dav.so /opt:ref +# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /out:".\Release\mod_dav.so" /base:@..\..\..\os\win32\BaseAddr.ref,mod_dav.so +# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_dav.so" /base:@..\..\..\os\win32\BaseAddr.ref,mod_dav.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_dav.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_dav - Win32 Debug" @@ -78,8 +84,14 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_dav.so" /base:@..\..\..\os\win32\BaseAddr.ref,mod_dav.so -# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_dav.so" /base:@..\..\..\os\win32\BaseAddr.ref,mod_dav.so +# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_dav.so" /base:@..\..\..\os\win32\BaseAddr.ref,mod_dav.so +# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_dav.so" /base:@..\..\..\os\win32\BaseAddr.ref,mod_dav.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_dav.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 diff --git a/modules/debug/NWGNUmakefile b/modules/debug/NWGNUmakefile index 7e3e1486..8a1993d3 100644 --- a/modules/debug/NWGNUmakefile +++ b/modules/debug/NWGNUmakefile @@ -59,7 +59,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -73,7 +73,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -95,7 +95,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = +NLM_NAME = # # This is used by the link '-desc ' directive. @@ -113,7 +113,7 @@ NLM_THREAD_NAME = # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -139,14 +139,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = +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 = +XDCDATA = # # If there is an NLM target, put it here @@ -155,7 +155,6 @@ TARGET_nlm = \ $(OBJDIR)/moddumpio.nlm \ $(OBJDIR)/modbucketeer.nlm \ $(EOLIST) - # # If there is an LIB target, put it here @@ -210,13 +209,13 @@ FILES_nlm_Ximports = \ # 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) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -231,7 +230,7 @@ nlms :: libs $(TARGET_nlm) # correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) # install :: nlms FORCE - copy $(OBJDIR)\*.nlm $(INSTALL)\Apache2\modules\*.* + copy $(OBJDIR)\*.nlm $(INSTALL)\$(BASEDIR)\modules\*.* # # Any specialized rules here @@ -243,4 +242,5 @@ install :: nlms FORCE # include $(AP_WORK)\build\NWGNUtail.inc - + + diff --git a/modules/debug/NWGNUmodbucketeer b/modules/debug/NWGNUmodbucketeer index 1c14170a..739ba354 100644 --- a/modules/debug/NWGNUmodbucketeer +++ b/modules/debug/NWGNUmodbucketeer @@ -28,7 +28,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -58,7 +57,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -72,7 +71,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -94,7 +93,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = modbucketeer +NLM_NAME = modbucketeer # # This is used by the link '-desc ' directive. @@ -112,7 +111,7 @@ NLM_THREAD_NAME = Bucketeer Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -138,14 +137,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -173,7 +172,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -215,13 +214,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ bucketeer_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -248,3 +247,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/debug/NWGNUmoddumpio b/modules/debug/NWGNUmoddumpio index 7db7075d..349db536 100644 --- a/modules/debug/NWGNUmoddumpio +++ b/modules/debug/NWGNUmoddumpio @@ -28,7 +28,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -58,7 +57,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -72,7 +71,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -94,7 +93,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = moddumpio +NLM_NAME = moddumpio # # This is used by the link '-desc ' directive. @@ -112,7 +111,7 @@ NLM_THREAD_NAME = DumpIO Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -138,14 +137,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -173,7 +172,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -215,13 +214,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ dumpio_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -248,3 +247,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/debug/mod_bucketeer.dsp b/modules/debug/mod_bucketeer.dsp index 9e8ddcd4..58337c2a 100644 --- a/modules/debug/mod_bucketeer.dsp +++ b/modules/debug/mod_bucketeer.dsp @@ -52,8 +52,14 @@ 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_bucketeer.so" /base:@..\..\os\win32\BaseAddr.ref,mod_bucketeer.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_bucketeer.so" /base:@..\..\os\win32\BaseAddr.ref,mod_bucketeer.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_bucketeer.so" /base:@..\..\os\win32\BaseAddr.ref,mod_bucketeer.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_bucketeer.so" /base:@..\..\os\win32\BaseAddr.ref,mod_bucketeer.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_bucketeer.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_bucketeer - Win32 Debug" @@ -78,8 +84,14 @@ 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_bucketeer.so" /base:@..\..\os\win32\BaseAddr.ref,mod_bucketeer.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_bucketeer.so" /base:@..\..\os\win32\BaseAddr.ref,mod_bucketeer.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_bucketeer.so" /base:@..\..\os\win32\BaseAddr.ref,mod_bucketeer.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_bucketeer.so" /base:@..\..\os\win32\BaseAddr.ref,mod_bucketeer.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_bucketeer.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 diff --git a/modules/debug/mod_dumpio.c b/modules/debug/mod_dumpio.c index a0cf22d2..f4fdbba0 100644 --- a/modules/debug/mod_dumpio.c +++ b/modules/debug/mod_dumpio.c @@ -67,6 +67,9 @@ static void dumpit(ap_filter_t *f, apr_bucket *b) if (nbytes) { obuf = malloc(nbytes+1); /* use pool? */ memcpy(obuf, buf, nbytes); +#if APR_CHARSET_EBCDIC + ap_xlate_proto_from_ascii(obuf, nbytes); +#endif obuf[nbytes] = '\0'; ap_log_error(APLOG_MARK, ptr->loglevel, 0, c->base_server, "mod_dumpio: %s (%s-%s): %s", diff --git a/modules/debug/mod_dumpio.dsp b/modules/debug/mod_dumpio.dsp index 20072b19..d15965e0 100644 --- a/modules/debug/mod_dumpio.dsp +++ b/modules/debug/mod_dumpio.dsp @@ -52,8 +52,14 @@ 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_dumpio.so" /base:@..\..\os\win32\BaseAddr.ref,mod_dumpio.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_dumpio.so" /base:@..\..\os\win32\BaseAddr.ref,mod_dumpio.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_dumpio.so" /base:@..\..\os\win32\BaseAddr.ref,mod_dumpio.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_dumpio.so" /base:@..\..\os\win32\BaseAddr.ref,mod_dumpio.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_dumpio.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_dumpio - Win32 Debug" @@ -78,8 +84,14 @@ 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_dumpio.so" /base:@..\..\os\win32\BaseAddr.ref,mod_dumpio.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_dumpio.so" /base:@..\..\os\win32\BaseAddr.ref,mod_dumpio.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_dumpio.so" /base:@..\..\os\win32\BaseAddr.ref,mod_dumpio.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_dumpio.so" /base:@..\..\os\win32\BaseAddr.ref,mod_dumpio.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_dumpio.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 diff --git a/modules/echo/NWGNUmakefile b/modules/echo/NWGNUmakefile index d3d40e28..d456bf19 100644 --- a/modules/echo/NWGNUmakefile +++ b/modules/echo/NWGNUmakefile @@ -36,7 +36,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -66,7 +65,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -80,7 +79,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -102,7 +101,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = echo +NLM_NAME = echo # # This is used by the link '-desc ' directive. @@ -120,7 +119,7 @@ NLM_THREAD_NAME = Echo Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -146,14 +145,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -181,7 +180,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -223,13 +222,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ echo_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -244,7 +243,7 @@ nlms :: libs $(TARGET_nlm) # correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) # install :: nlms FORCE - copy $(OBJDIR)\*.nlm $(INSTALL)\Apache2\modules\*.* + copy $(OBJDIR)\*.nlm $(INSTALL)\$(BASEDIR)\modules\*.* # # Any specialized rules here @@ -258,4 +257,3 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc - diff --git a/modules/echo/mod_echo.dsp b/modules/echo/mod_echo.dsp index 2510e7d1..5d009695 100644 --- a/modules/echo/mod_echo.dsp +++ b/modules/echo/mod_echo.dsp @@ -52,8 +52,14 @@ 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_echo.so" /base:@..\..\os\win32\BaseAddr.ref,mod_echo.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_echo.so" /base:@..\..\os\win32\BaseAddr.ref,mod_echo.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_echo.so" /base:@..\..\os\win32\BaseAddr.ref,mod_echo.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_echo.so" /base:@..\..\os\win32\BaseAddr.ref,mod_echo.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_echo.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_echo - Win32 Debug" @@ -78,8 +84,14 @@ 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_echo.so" /base:@..\..\os\win32\BaseAddr.ref,mod_echo.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_echo.so" /base:@..\..\os\win32\BaseAddr.ref,mod_echo.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_echo.so" /base:@..\..\os\win32\BaseAddr.ref,mod_echo.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_echo.so" /base:@..\..\os\win32\BaseAddr.ref,mod_echo.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_echo.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 diff --git a/modules/experimental/NWGNUcase_flt b/modules/experimental/NWGNUcase_flt new file mode 100644 index 00000000..f696b863 --- /dev/null +++ b/modules/experimental/NWGNUcase_flt @@ -0,0 +1,258 @@ +# +# 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 += \ + $(AP_WORK)/include \ + $(NWOS) \ + $(AP_WORK)/modules/arch/netware \ + $(APR)/include \ + $(APRUTIL)/include \ + $(APR) \ + $(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 = case_flt + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = Apache $(VERSION_STR) Case Filter Module + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = $(NLM_NAME) Module + +# +# 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 = 8192 + + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = _LibCPrelude + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = _LibCPostlude + +# +# 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 = AUTOUNLOAD, PSEUDOPREEMPTION + +# +# 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)/$(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_case_filter.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 = \ + libcpre.o \ + $(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 = \ + aprlib \ + 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 = \ + @$(APR)/aprlib.imp \ + @$(NWOS)/httpd.imp \ + @libc.imp \ + $(EOLIST) + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + case_filter_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 $(AP_WORK)\build\NWGNUtail.inc + + diff --git a/modules/experimental/NWGNUcase_flt_in b/modules/experimental/NWGNUcase_flt_in new file mode 100644 index 00000000..d9ec3113 --- /dev/null +++ b/modules/experimental/NWGNUcase_flt_in @@ -0,0 +1,258 @@ +# +# 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 += \ + $(AP_WORK)/include \ + $(NWOS) \ + $(AP_WORK)/modules/arch/netware \ + $(APR)/include \ + $(APRUTIL)/include \ + $(APR) \ + $(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 = case_flt_in + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = Apache $(VERSION_STR) Case Filter In Module + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = $(NLM_NAME) Module + +# +# 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 = 8192 + + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = _LibCPrelude + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = _LibCPostlude + +# +# 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 = AUTOUNLOAD, PSEUDOPREEMPTION + +# +# 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)/$(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_case_filter_in.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 = \ + libcpre.o \ + $(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 = \ + aprlib \ + 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 = \ + @$(APR)/aprlib.imp \ + @$(NWOS)/httpd.imp \ + @libc.imp \ + $(EOLIST) + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + case_filter_in_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 $(AP_WORK)\build\NWGNUtail.inc + + diff --git a/modules/experimental/NWGNUexample b/modules/experimental/NWGNUexample index 13c97b1d..89792616 100644 --- a/modules/experimental/NWGNUexample +++ b/modules/experimental/NWGNUexample @@ -36,7 +36,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -66,7 +65,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -80,7 +79,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -102,7 +101,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = example +NLM_NAME = example # # This is used by the link '-desc ' directive. @@ -120,7 +119,7 @@ NLM_THREAD_NAME = Example Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -146,14 +145,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -181,7 +180,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -229,7 +228,7 @@ FILES_nlm_exports = \ # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -257,4 +256,3 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc - diff --git a/modules/experimental/NWGNUmakefile b/modules/experimental/NWGNUmakefile index 16af52c8..1189aa8f 100644 --- a/modules/experimental/NWGNUmakefile +++ b/modules/experimental/NWGNUmakefile @@ -59,7 +59,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -73,7 +73,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -95,7 +95,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = +NLM_NAME = # # This is used by the link '-desc ' directive. @@ -113,7 +113,7 @@ NLM_THREAD_NAME = # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -139,14 +139,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = +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 = +XDCDATA = # # If there is an NLM target, put it here @@ -161,9 +161,10 @@ XDCDATA = # submakefile is added, the extra reference to example.nlm should be removed. TARGET_nlm = \ $(OBJDIR)/example.nlm \ - $(OBJDIR)/example.nlm \ + $(OBJDIR)/case_flt.nlm \ + $(OBJDIR)/case_flt_in.nlm \ $(EOLIST) - + # # If there is an LIB target, put it here # @@ -223,7 +224,7 @@ FILES_nlm_exports = \ # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -238,7 +239,7 @@ nlms :: libs $(TARGET_nlm) # correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) # install :: nlms FORCE - copy $(OBJDIR)\*.nlm $(INSTALL)\Apache2\modules\*.* + copy $(OBJDIR)\*.nlm $(INSTALL)\$(BASEDIR)\modules\*.* # # Any specialized rules here @@ -251,3 +252,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/experimental/mod_case_filter.dsp b/modules/experimental/mod_case_filter.dsp new file mode 100644 index 00000000..8f65689d --- /dev/null +++ b/modules/experimental/mod_case_filter.dsp @@ -0,0 +1,111 @@ +# Microsoft Developer Studio Project File - Name="mod_case_filter" - 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_case_filter - 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_case_filter.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For case_filter: +!MESSAGE +!MESSAGE NMAKE /f "mod_case_filter.mak" CFG="mod_case_filter - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "mod_case_filter - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "mod_case_filter - 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_case_filter - 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_case_filter_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_case_filter.res" /i "../../include" /i "../../srclib/apr/include" /d "NDEBUG" /d BIN_NAME="mod_case_filter.so" /d LONG_NAME="case_filter_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_case_filter.so" /base:@..\..\os\win32\BaseAddr.ref,mod_case_filter.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_case_filter.so" /base:@..\..\os\win32\BaseAddr.ref,mod_case_filter.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_case_filter.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_case_filter - 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_case_filter_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_case_filter.res" /i "../../include" /i "../../srclib/apr/include" /d "_DEBUG" /d BIN_NAME="mod_case_filter.so" /d LONG_NAME="case_filter_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_case_filter.so" /base:@..\..\os\win32\BaseAddr.ref,mod_case_filter.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_case_filter.so" /base:@..\..\os\win32\BaseAddr.ref,mod_case_filter.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_case_filter.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_case_filter - Win32 Release" +# Name "mod_case_filter - Win32 Debug" +# Begin Source File + +SOURCE=.\mod_case_filter.c +# End Source File +# Begin Source File + +SOURCE=..\..\build\win32\httpd.rc +# End Source File +# End Target +# End Project diff --git a/modules/experimental/mod_case_filter_in.c b/modules/experimental/mod_case_filter_in.c index 90c90d36..d4747940 100644 --- a/modules/experimental/mod_case_filter_in.c +++ b/modules/experimental/mod_case_filter_in.c @@ -90,7 +90,7 @@ static apr_status_t CaseFilterInFilter(ap_filter_t *f, const char *data; apr_size_t len; char *buf; - int n; + apr_size_t n; /* It is tempting to do this... * APR_BUCKET_REMOVE(pB); diff --git a/modules/experimental/mod_case_filter_in.dsp b/modules/experimental/mod_case_filter_in.dsp new file mode 100644 index 00000000..8a007931 --- /dev/null +++ b/modules/experimental/mod_case_filter_in.dsp @@ -0,0 +1,111 @@ +# Microsoft Developer Studio Project File - Name="mod_case_filter_in" - 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_case_filter_in - 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_case_filter_in.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For case_filter_in: +!MESSAGE +!MESSAGE NMAKE /f "mod_case_filter_in.mak" CFG="mod_case_filter_in - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "mod_case_filter_in - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "mod_case_filter_in - 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_case_filter_in - 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_case_filter_in_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_case_filter_in.res" /i "../../include" /i "../../srclib/apr/include" /d "NDEBUG" /d BIN_NAME="mod_case_filter_in.so" /d LONG_NAME="case_filter_in_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_case_filter_in.so" /base:@..\..\os\win32\BaseAddr.ref,mod_case_filter_in.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_case_filter_in.so" /base:@..\..\os\win32\BaseAddr.ref,mod_case_filter_in.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_case_filter_in.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_case_filter_in - 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_case_filter_in_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_case_filter_in.res" /i "../../include" /i "../../srclib/apr/include" /d "_DEBUG" /d BIN_NAME="mod_case_filter_in.so" /d LONG_NAME="case_filter_in_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_case_filter_in.so" /base:@..\..\os\win32\BaseAddr.ref,mod_case_filter_in.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_case_filter_in.so" /base:@..\..\os\win32\BaseAddr.ref,mod_case_filter_in.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_case_filter_in.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_case_filter_in - Win32 Release" +# Name "mod_case_filter_in - Win32 Debug" +# Begin Source File + +SOURCE=.\mod_case_filter_in.c +# End Source File +# Begin Source File + +SOURCE=..\..\build\win32\httpd.rc +# End Source File +# End Target +# End Project diff --git a/modules/experimental/mod_example.dsp b/modules/experimental/mod_example.dsp new file mode 100644 index 00000000..47b6fe33 --- /dev/null +++ b/modules/experimental/mod_example.dsp @@ -0,0 +1,111 @@ +# Microsoft Developer Studio Project File - Name="mod_example" - 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_example - 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_example.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_example.mak" CFG="mod_example - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "mod_example - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "mod_example - 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_example - 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_example_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_example.res" /i "../../include" /i "../../srclib/apr/include" /d "NDEBUG" /d BIN_NAME="mod_example.so" /d LONG_NAME="example_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_example.so" /base:@..\..\os\win32\BaseAddr.ref,mod_example.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_example.so" /base:@..\..\os\win32\BaseAddr.ref,mod_example.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_example.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_example - 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_example_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_example.res" /i "../../include" /i "../../srclib/apr/include" /d "_DEBUG" /d BIN_NAME="mod_example.so" /d LONG_NAME="example_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_example.so" /base:@..\..\os\win32\BaseAddr.ref,mod_example.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_example.so" /base:@..\..\os\win32\BaseAddr.ref,mod_example.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_example.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_example - Win32 Release" +# Name "mod_example - Win32 Debug" +# Begin Source File + +SOURCE=.\mod_example.c +# End Source File +# Begin Source File + +SOURCE=..\..\build\win32\httpd.rc +# End Source File +# End Target +# End Project diff --git a/modules/filters/NWGNUcharsetl b/modules/filters/NWGNUcharsetl index 7094e944..8e28c285 100644 --- a/modules/filters/NWGNUcharsetl +++ b/modules/filters/NWGNUcharsetl @@ -42,7 +42,7 @@ XCFLAGS += \ # These defines will come after DEFINES # XDEFINES += \ - -DAP_WANT_DIR_TRANSLATION \ + -DAP_WANT_DIR_TRANSLATION \ $(EOLIST) # @@ -102,7 +102,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = charsetl +NLM_NAME = charsetl # # This is used by the link '-desc ' directive. @@ -120,7 +120,7 @@ NLM_THREAD_NAME = charsetl # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -146,14 +146,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -229,7 +229,7 @@ FILES_nlm_exports = \ # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -257,4 +257,3 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc - diff --git a/modules/filters/NWGNUdeflate b/modules/filters/NWGNUdeflate index 53b4f789..635746d6 100644 --- a/modules/filters/NWGNUdeflate +++ b/modules/filters/NWGNUdeflate @@ -104,7 +104,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = deflate +NLM_NAME = deflate # # This is used by the link '-desc ' directive. @@ -262,7 +262,7 @@ nlms :: libs $(TARGET_nlm) # correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) # install :: nlms FORCE - copy $(OBJDIR)\*.nlm $(INSTALL)\Apache2\modules\*.* + copy $(OBJDIR)\*.nlm $(INSTALL)\$(BASEDIR)\modules\*.* # # Any specialized rules here @@ -278,4 +278,3 @@ vpath %.c $(ZLIBSDK) include $(AP_WORK)\build\NWGNUtail.inc - diff --git a/modules/filters/NWGNUextfiltr b/modules/filters/NWGNUextfiltr index 1de291ca..c517f698 100644 --- a/modules/filters/NWGNUextfiltr +++ b/modules/filters/NWGNUextfiltr @@ -28,7 +28,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -58,7 +57,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -72,7 +71,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -94,7 +93,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = extfiltr +NLM_NAME = extfiltr # # This is used by the link '-desc ' directive. @@ -112,7 +111,7 @@ NLM_THREAD_NAME = ExtFilter Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -138,14 +137,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -173,7 +172,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -215,13 +214,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ ext_filter_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -248,3 +247,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/filters/NWGNUmakefile b/modules/filters/NWGNUmakefile index 07600afd..4433689e 100644 --- a/modules/filters/NWGNUmakefile +++ b/modules/filters/NWGNUmakefile @@ -59,7 +59,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -73,7 +73,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -95,7 +95,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = +NLM_NAME = # # This is used by the link '-desc ' directive. @@ -113,7 +113,7 @@ NLM_THREAD_NAME = # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -139,14 +139,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = +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 = +XDCDATA = # # If there is an NLM target, put it here @@ -156,12 +156,12 @@ TARGET_nlm = \ $(OBJDIR)/charsetl.nlm \ $(OBJDIR)/mod_filter.nlm \ $(EOLIST) - + # If the zlib libraries source exists then build the mod_deflate module ifneq "$(ZLIBSDK)" "" ifeq "$(wildcard $(ZLIBSDK))" "$(ZLIBSDK)" TARGET_nlm += $(OBJDIR)/deflate.nlm \ - $(EOLIST) + $(EOLIST) endif endif @@ -224,7 +224,7 @@ FILES_nlm_exports = \ # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -239,7 +239,7 @@ nlms :: libs $(TARGET_nlm) # correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) # install :: nlms FORCE - copy $(OBJDIR)\*.nlm $(INSTALL)\Apache2\modules\*.* + copy $(OBJDIR)\*.nlm $(INSTALL)\$(BASEDIR)\modules\*.* # # Any specialized rules here @@ -252,3 +252,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/filters/NWGNUmod_filter b/modules/filters/NWGNUmod_filter index ec671c59..38696055 100644 --- a/modules/filters/NWGNUmod_filter +++ b/modules/filters/NWGNUmod_filter @@ -28,7 +28,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -58,7 +57,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -72,7 +71,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -94,7 +93,7 @@ endif # 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_filter +NLM_NAME = mod_filter # # This is used by the link '-desc ' directive. @@ -112,7 +111,7 @@ NLM_THREAD_NAME = Filter Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -138,14 +137,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -173,7 +172,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -215,13 +214,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ filter_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -248,3 +247,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/filters/mod_charset_lite.dsp b/modules/filters/mod_charset_lite.dsp index e586e6f3..0fd575f8 100644 --- a/modules/filters/mod_charset_lite.dsp +++ b/modules/filters/mod_charset_lite.dsp @@ -53,7 +53,13 @@ BSC32=bscmake.exe # 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_charset_lite.so" /base:@..\..\os\win32\BaseAddr.ref,mod_charset_lite.so /opt:ref +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_charset_lite.so" /base:@..\..\os\win32\BaseAddr.ref,mod_charset_lite.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_charset_lite.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_charset_lite - Win32 Debug" @@ -79,7 +85,13 @@ BSC32=bscmake.exe # 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_charset_lite.so" /base:@..\..\os\win32\BaseAddr.ref,mod_charset_lite.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_charset_lite.so" /base:@..\..\os\win32\BaseAddr.ref,mod_charset_lite.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_charset_lite.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 diff --git a/modules/filters/mod_deflate.c b/modules/filters/mod_deflate.c index 2fd15cba..f82b75b7 100644 --- a/modules/filters/mod_deflate.c +++ b/modules/filters/mod_deflate.c @@ -37,6 +37,7 @@ #include "httpd.h" #include "http_config.h" #include "http_log.h" +#include "apr_lib.h" #include "apr_strings.h" #include "apr_general.h" #include "util_filter.h" @@ -82,6 +83,83 @@ static const char deflate_magic[2] = { '\037', '\213' }; #define DEFAULT_MEMLEVEL 9 #define DEFAULT_BUFFERSIZE 8096 + +/* Check whether a request is gzipped, so we can un-gzip it. + * If a request has multiple encodings, we need the gzip + * to be the outermost non-identity encoding. + */ +static int check_gzip(request_rec *r, apr_table_t *hdrs1, apr_table_t *hdrs2) +{ + int found = 0; + apr_table_t *hdrs = hdrs1; + const char *encoding = apr_table_get(hdrs, "Content-Encoding"); + + if (!encoding && (hdrs2 != NULL)) { + /* the output filter has two tables and a content_encoding to check */ + encoding = apr_table_get(hdrs2, "Content-Encoding"); + hdrs = hdrs2; + if (!encoding) { + encoding = r->content_encoding; + hdrs = NULL; + } + } + if (encoding && *encoding) { + + /* check the usual/simple case first */ + if (!strcasecmp(encoding, "gzip") + || !strcasecmp(encoding, "x-gzip")) { + found = 1; + if (hdrs) { + apr_table_unset(hdrs, "Content-Encoding"); + } + else { + r->content_encoding = NULL; + } + } + else if (ap_strchr_c(encoding, ',') != NULL) { + /* If the outermost encoding isn't gzip, there's nowt + * we can do. So only check the last non-identity token + */ + char *new_encoding = apr_pstrdup(r->pool, encoding); + char *ptr; + for(;;) { + char *token = ap_strrchr(new_encoding, ','); + if (!token) { /* gzip:identity or other:identity */ + if (!strcasecmp(new_encoding, "gzip") + || !strcasecmp(new_encoding, "x-gzip")) { + found = 1; + if (hdrs) { + apr_table_unset(hdrs, "Content-Encoding"); + } + else { + r->content_encoding = NULL; + } + } + break; /* seen all tokens */ + } + for (ptr=token+1; apr_isspace(*ptr); ++ptr); + if (!strcasecmp(ptr, "gzip") + || !strcasecmp(ptr, "x-gzip")) { + *token = '\0'; + if (hdrs) { + apr_table_setn(hdrs, "Content-Encoding", new_encoding); + } + else { + r->content_encoding = new_encoding; + } + found = 1; + } + else if (!ptr[0] || !strcasecmp(ptr, "identity")) { + *token = '\0'; + continue; /* strip the token and find the next one */ + } + break; /* found a non-identity token */ + } + } + } + return found; +} + /* Outputs a long in LSB order to the given file * only the bottom 4 bits are required for the deflate file format. */ @@ -335,6 +413,12 @@ static apr_status_t deflate_out_filter(ap_filter_t *f, return ap_pass_brigade(f->next, bb); } + /* We can't operate on Content-Ranges */ + if (apr_table_get(r->headers_out, "Content-Range") != NULL) { + ap_remove_output_filter(f); + return ap_pass_brigade(f->next, bb); + } + /* Some browsers might have problems with content types * other than text/html, so set gzip-only-text/html * (with browsermatch) for them @@ -484,6 +568,7 @@ static apr_status_t deflate_out_filter(ap_filter_t *f, apr_table_mergen(r->headers_out, "Content-Encoding", "gzip"); } apr_table_unset(r->headers_out, "Content-Length"); + apr_table_unset(r->headers_out, "Content-MD5"); /* initialize deflate output buffer */ ctx->stream.next_out = ctx->buffer; @@ -578,6 +663,16 @@ static apr_status_t deflate_out_filter(ap_filter_t *f, continue; } + if (APR_BUCKET_IS_METADATA(e)) { + /* + * Remove meta data bucket from old brigade and insert into the + * new. + */ + APR_BUCKET_REMOVE(e); + APR_BRIGADE_INSERT_TAIL(ctx->bb, e); + continue; + } + /* read */ apr_bucket_read(e, &data, &len, APR_BLOCK_READ); @@ -644,9 +739,7 @@ static apr_status_t deflate_in_filter(ap_filter_t *f, c = ap_get_module_config(r->server->module_config, &deflate_module); if (!ctx) { - int found = 0; - char *token, deflate_hdr[10]; - const char *encoding; + char deflate_hdr[10]; apr_size_t len; /* only work on main request/no subrequests */ @@ -655,26 +748,20 @@ static apr_status_t deflate_in_filter(ap_filter_t *f, return ap_get_brigade(f->next, bb, mode, block, readbytes); } - /* Let's see what our current Content-Encoding is. - * If gzip is present, don't gzip again. (We could, but let's not.) - */ - encoding = apr_table_get(r->headers_in, "Content-Encoding"); - if (encoding) { - const char *tmp = encoding; - - token = ap_get_token(r->pool, &tmp, 0); - while (token && token[0]) { - if (!strcasecmp(token, "gzip")) { - found = 1; - break; - } - /* Otherwise, skip token */ - tmp++; - token = ap_get_token(r->pool, &tmp, 0); - } + /* We can't operate on Content-Ranges */ + if (apr_table_get(r->headers_in, "Content-Range") != NULL) { + ap_remove_input_filter(f); + return ap_get_brigade(f->next, bb, mode, block, readbytes); } - if (found == 0) { + /* Check whether request body is gzipped. + * + * If it is, we're transforming the contents, invalidating + * some request headers including Content-Encoding. + * + * If not, we just remove ourself. + */ + if (check_gzip(r, r->headers_in, NULL) == 0) { ap_remove_input_filter(f); return ap_get_brigade(f->next, bb, mode, block, readbytes); } @@ -689,6 +776,9 @@ static apr_status_t deflate_in_filter(ap_filter_t *f, return rv; } + apr_table_unset(r->headers_in, "Content-Length"); + apr_table_unset(r->headers_in, "Content-MD5"); + len = 10; rv = apr_brigade_flatten(ctx->bb, deflate_hdr, &len); if (rv != APR_SUCCESS) { @@ -909,9 +999,6 @@ static apr_status_t inflate_out_filter(ap_filter_t *f, c = ap_get_module_config(r->server->module_config, &deflate_module); if (!ctx) { - int found = 0; - char *token; - const char *encoding; /* only work on main request/no subrequests */ if (!ap_is_initial_req(r)) { @@ -919,31 +1006,20 @@ static apr_status_t inflate_out_filter(ap_filter_t *f, return ap_pass_brigade(f->next, bb); } + /* We can't operate on Content-Ranges */ + if (apr_table_get(r->headers_out, "Content-Range") != NULL) { + ap_remove_output_filter(f); + return ap_pass_brigade(f->next, bb); + } + /* * Let's see what our current Content-Encoding is. - * Only inflate if gzip is present. + * Only inflate if gzipped. */ - encoding = apr_table_get(r->headers_out, "Content-Encoding"); - if (encoding) { - const char *tmp = encoding; - - token = ap_get_token(r->pool, &tmp, 0); - while (token && token[0]) { - if (!strcasecmp(token, "gzip")) { - found = 1; - break; - } - /* Otherwise, skip token */ - tmp++; - token = ap_get_token(r->pool, &tmp, 0); - } - } - - if (found == 0) { + if (check_gzip(r, r->headers_out, r->err_headers_out) == 0) { ap_remove_output_filter(f); return ap_pass_brigade(f->next, bb); } - apr_table_unset(r->headers_out, "Content-Encoding"); /* No need to inflate HEAD or 204/304 */ if (APR_BUCKET_IS_EOS(APR_BRIGADE_FIRST(bb))) { @@ -951,7 +1027,6 @@ static apr_status_t inflate_out_filter(ap_filter_t *f, return ap_pass_brigade(f->next, bb); } - f->ctx = ctx = apr_pcalloc(f->r->pool, sizeof(*ctx)); ctx->bb = apr_brigade_create(r->pool, f->c->bucket_alloc); ctx->buffer = apr_palloc(r->pool, c->bufferSize); @@ -984,7 +1059,9 @@ static apr_status_t inflate_out_filter(ap_filter_t *f, apr_pool_cleanup_register(r->pool, ctx, deflate_ctx_cleanup, apr_pool_cleanup_null); + /* these are unlikely to be set anyway, but ... */ apr_table_unset(r->headers_out, "Content-Length"); + apr_table_unset(r->headers_out, "Content-MD5"); /* initialize inflate output buffer */ ctx->stream.next_out = ctx->buffer; @@ -1081,6 +1158,16 @@ static apr_status_t inflate_out_filter(ap_filter_t *f, continue; } + if (APR_BUCKET_IS_METADATA(e)) { + /* + * Remove meta data bucket from old brigade and insert into the + * new. + */ + APR_BUCKET_REMOVE(e); + APR_BRIGADE_INSERT_TAIL(ctx->bb, e); + continue; + } + /* read */ apr_bucket_read(e, &data, &len, APR_BLOCK_READ); diff --git a/modules/filters/mod_deflate.dsp b/modules/filters/mod_deflate.dsp index faa14605..478eec66 100644 --- a/modules/filters/mod_deflate.dsp +++ b/modules/filters/mod_deflate.dsp @@ -52,8 +52,14 @@ 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_deflate.so" /base:@..\..\os\win32\BaseAddr.ref,mod_deflate.so -# ADD LINK32 kernel32.lib zlib.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_deflate.so" /libpath:"../../srclib/zlib" /base:@..\..\os\win32\BaseAddr.ref,mod_deflate.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_deflate.so" /base:@..\..\os\win32\BaseAddr.ref,mod_deflate.so +# ADD LINK32 kernel32.lib zlib.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_deflate.so" /libpath:"../../srclib/zlib" /base:@..\..\os\win32\BaseAddr.ref,mod_deflate.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_deflate.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_deflate - Win32 Debug" @@ -78,8 +84,14 @@ 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_deflate.so" /base:@..\..\os\win32\BaseAddr.ref,mod_deflate.so -# ADD LINK32 kernel32.lib zlib.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_deflate.so" /libpath:"../../srclib/zlib" /base:@..\..\os\win32\BaseAddr.ref,mod_deflate.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_deflate.so" /base:@..\..\os\win32\BaseAddr.ref,mod_deflate.so +# ADD LINK32 kernel32.lib zlib.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_deflate.so" /libpath:"../../srclib/zlib" /base:@..\..\os\win32\BaseAddr.ref,mod_deflate.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_deflate.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 diff --git a/modules/filters/mod_ext_filter.dsp b/modules/filters/mod_ext_filter.dsp index 27862cdb..7b77b674 100644 --- a/modules/filters/mod_ext_filter.dsp +++ b/modules/filters/mod_ext_filter.dsp @@ -52,8 +52,14 @@ 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_ext_filter.so" /base:@..\..\os\win32\BaseAddr.ref,mod_ext_filter.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_ext_filter.so" /base:@..\..\os\win32\BaseAddr.ref,mod_ext_filter.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_ext_filter.so" /base:@..\..\os\win32\BaseAddr.ref,mod_ext_filter.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_ext_filter.so" /base:@..\..\os\win32\BaseAddr.ref,mod_ext_filter.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_ext_filter.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_ext_filter - Win32 Debug" @@ -78,8 +84,14 @@ 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_ext_filter.so" /base:@..\..\os\win32\BaseAddr.ref,mod_ext_filter.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_ext_filter.so" /base:@..\..\os\win32\BaseAddr.ref,mod_ext_filter.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_ext_filter.so" /base:@..\..\os\win32\BaseAddr.ref,mod_ext_filter.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_ext_filter.so" /base:@..\..\os\win32\BaseAddr.ref,mod_ext_filter.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_ext_filter.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 diff --git a/modules/filters/mod_filter.c b/modules/filters/mod_filter.c index ae167178..778895b4 100644 --- a/modules/filters/mod_filter.c +++ b/modules/filters/mod_filter.c @@ -200,11 +200,10 @@ static int filter_lookup(ap_filter_t *f, ap_filter_rec_t *filter) match = 0; } } - else if (!provider->match.string) { - match = 0; - } + /* we can't check for NULL in provider as that kills integer 0 + * so we have to test each string/regexp case in the switch + */ else { - /* Now we have no nulls, so we can do string and regexp matching */ switch (provider->match_type) { case STRING_MATCH: if (strcasecmp(str, provider->match.string)) { @@ -221,7 +220,7 @@ static int filter_lookup(ap_filter_t *f, ap_filter_rec_t *filter) case REGEX_MATCH: if (ap_regexec(provider->match.regex, str, 0, NULL, 0) == AP_REG_NOMATCH) { - match = 0; + match = 0; } break; case INT_EQ: @@ -229,23 +228,26 @@ static int filter_lookup(ap_filter_t *f, ap_filter_rec_t *filter) match = 0; } break; + /* Integer comparisons should be [var] OP [match] + * We need to set match = 0 if the condition fails + */ case INT_LT: - if (atoi(str) < provider->match.number) { + if (atoi(str) >= provider->match.number) { match = 0; } break; case INT_LE: - if (atoi(str) <= provider->match.number) { + if (atoi(str) > provider->match.number) { match = 0; } break; case INT_GT: - if (atoi(str) > provider->match.number) { + if (atoi(str) <= provider->match.number) { match = 0; } break; case INT_GE: - if (atoi(str) >= provider->match.number) { + if (atoi(str) < provider->match.number) { match = 0; } break; @@ -589,6 +591,9 @@ static const char *filter_provider(cmd_parms *cmd, void *CFG, const char *args) match, rxend-match), flags); + if (provider->match.regex == NULL) { + return "Bad regexp"; + } break; case '*': provider->match_type = DEFINED; @@ -688,12 +693,20 @@ static const char *filter_chain(cmd_parms *cmd, void *CFG, const char *arg) break; case '!': /* Empty the chain */ - cfg->chain = NULL; + /** IG: Add a NULL provider to the beginning so that + * we can ensure that we'll empty everything before + * this when doing config merges later */ + p = apr_pcalloc(cmd->pool, sizeof(mod_filter_chain)); + p->fname = NULL; + cfg->chain = p; break; case '=': /* initialise chain with this arg */ + /** IG: Prepend a NULL provider to the beginning as above */ p = apr_pcalloc(cmd->pool, sizeof(mod_filter_chain)); - p->fname = arg+1; + p->fname = NULL; + p->next = apr_pcalloc(cmd->pool, sizeof(mod_filter_chain)); + p->next->fname = arg+1; cfg->chain = p; break; @@ -739,6 +752,14 @@ static void filter_insert(request_rec *r) ap_set_module_config(r->request_config, &filter_module, ctx); #endif + /** IG: Now that we've merged to the final config, go one last time + * through the chain, and prune out the NULL filters */ + + for (p = cfg->chain; p; p = p->next) { + if (p->fname == NULL) + cfg->chain = p->next; + } + for (p = cfg->chain; p; p = p->next) { filter = apr_hash_get(cfg->live_filters, p->fname, APR_HASH_KEY_STRING); if (filter == NULL) { @@ -788,7 +809,10 @@ static void *filter_merge(apr_pool_t *pool, void *BASE, void *ADD) if (base->chain && add->chain) { for (p = base->chain; p; p = p->next) { newlink = apr_pmemdup(pool, p, sizeof(mod_filter_chain)); - if (savelink) { + if (newlink->fname == NULL) { + conf->chain = savelink = newlink; + } + else if (savelink) { savelink->next = newlink; savelink = newlink; } @@ -799,8 +823,17 @@ static void *filter_merge(apr_pool_t *pool, void *BASE, void *ADD) for (p = add->chain; p; p = p->next) { newlink = apr_pmemdup(pool, p, sizeof(mod_filter_chain)); - savelink->next = newlink; - savelink = newlink; + /** Filter out merged chain resets */ + if (newlink->fname == NULL) { + conf->chain = savelink = newlink; + } + else if (savelink) { + savelink->next = newlink; + savelink = newlink; + } + else { + conf->chain = savelink = newlink; + } } } else if (add->chain) { diff --git a/modules/filters/mod_filter.dsp b/modules/filters/mod_filter.dsp new file mode 100644 index 00000000..1729238a --- /dev/null +++ b/modules/filters/mod_filter.dsp @@ -0,0 +1,111 @@ +# Microsoft Developer Studio Project File - Name="mod_filter" - 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_filter - Win32 Release +!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_filter.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_filter.mak" CFG="mod_filter - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "mod_filter - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "mod_filter - 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_filter - 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_filter_src" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /fo"Release/mod_deflate.res" /i "../../include" /i "../../srclib/apr/include" /d "NDEBUG" /d BIN_NAME="mod_deflate.so" /d LONG_NAME="deflate_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_filter.so" /base:@..\..\os\win32\BaseAddr.ref,mod_filter.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_filter.so" /base:@..\..\os\win32\BaseAddr.ref,mod_filter.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_filter.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_filter - 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_filter_src" /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /fo"Debug/mod_deflate.res" /i "../../include" /i "../../srclib/apr/include" /d "_DEBUG" /d BIN_NAME="mod_deflate.so" /d LONG_NAME="deflate_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_filter.so" /base:@..\..\os\win32\BaseAddr.ref,mod_filter.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_filter.so" /base:@..\..\os\win32\BaseAddr.ref,mod_filter.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_filter.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_filter - Win32 Release" +# Name "mod_filter - Win32 Debug" +# Begin Source File + +SOURCE=.\mod_filter.c +# End Source File +# Begin Source File + +SOURCE=..\..\build\win32\httpd.rc +# End Source File +# End Target +# End Project diff --git a/modules/filters/mod_include.dsp b/modules/filters/mod_include.dsp index 101d0a60..2b60f151 100644 --- a/modules/filters/mod_include.dsp +++ b/modules/filters/mod_include.dsp @@ -52,8 +52,14 @@ 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_include.so" /base:@..\..\os\win32\BaseAddr.ref,mod_include.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_include.so" /base:@..\..\os\win32\BaseAddr.ref,mod_include.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_include.so" /base:@..\..\os\win32\BaseAddr.ref,mod_include.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_include.so" /base:@..\..\os\win32\BaseAddr.ref,mod_include.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_include.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_include - Win32 Debug" @@ -78,8 +84,14 @@ 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_include.so" /base:@..\..\os\win32\BaseAddr.ref,mod_include.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_include.so" /base:@..\..\os\win32\BaseAddr.ref,mod_include.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_include.so" /base:@..\..\os\win32\BaseAddr.ref,mod_include.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_include.so" /base:@..\..\os\win32\BaseAddr.ref,mod_include.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_include.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 diff --git a/modules/generators/NWGNUautoindex b/modules/generators/NWGNUautoindex index 54465861..cc9619a6 100644 --- a/modules/generators/NWGNUautoindex +++ b/modules/generators/NWGNUautoindex @@ -29,7 +29,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -59,7 +58,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -73,7 +72,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -95,7 +94,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = autoindex +NLM_NAME = autoindex # # This is used by the link '-desc ' directive. @@ -113,7 +112,7 @@ NLM_THREAD_NAME = Autoindex Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -139,14 +138,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -174,7 +173,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -216,13 +215,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ autoindex_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -249,3 +248,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/generators/NWGNUinfo b/modules/generators/NWGNUinfo index 8d1a8972..e718539f 100644 --- a/modules/generators/NWGNUinfo +++ b/modules/generators/NWGNUinfo @@ -28,7 +28,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -58,7 +57,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -72,7 +71,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -94,7 +93,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = info +NLM_NAME = info # # This is used by the link '-desc ' directive. @@ -112,7 +111,7 @@ NLM_THREAD_NAME = Info Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -138,14 +137,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -173,7 +172,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -215,13 +214,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ info_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -248,3 +247,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/generators/NWGNUmakefile b/modules/generators/NWGNUmakefile index 67d67c40..a895d8c4 100644 --- a/modules/generators/NWGNUmakefile +++ b/modules/generators/NWGNUmakefile @@ -59,7 +59,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -73,7 +73,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -95,7 +95,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = +NLM_NAME = # # This is used by the link '-desc ' directive. @@ -113,7 +113,7 @@ NLM_THREAD_NAME = # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -139,14 +139,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = +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 = +XDCDATA = # # If there is an NLM target, put it here @@ -212,13 +212,13 @@ FILES_nlm_Ximports = \ # 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) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -233,7 +233,7 @@ nlms :: libs $(TARGET_nlm) # correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) # install :: nlms FORCE - copy $(OBJDIR)\*.nlm $(INSTALL)\Apache2\modules\*.* + copy $(OBJDIR)\*.nlm $(INSTALL)\$(BASEDIR)\modules\*.* # # Any specialized rules here @@ -247,4 +247,3 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc - diff --git a/modules/generators/NWGNUmod_asis b/modules/generators/NWGNUmod_asis index f4d22a99..62ce6eed 100644 --- a/modules/generators/NWGNUmod_asis +++ b/modules/generators/NWGNUmod_asis @@ -29,7 +29,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -59,7 +58,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -73,7 +72,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -95,7 +94,7 @@ endif # 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_asis +NLM_NAME = mod_asis # # This is used by the link '-desc ' directive. @@ -113,7 +112,7 @@ NLM_THREAD_NAME = Mod_asis Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -139,14 +138,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -174,7 +173,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -216,13 +215,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ asis_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -249,3 +248,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/generators/NWGNUmod_cgi b/modules/generators/NWGNUmod_cgi index 17962121..70d62558 100644 --- a/modules/generators/NWGNUmod_cgi +++ b/modules/generators/NWGNUmod_cgi @@ -30,7 +30,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -60,7 +59,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -74,7 +73,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -96,7 +95,7 @@ endif # 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_cgi +NLM_NAME = mod_cgi # # This is used by the link '-desc ' directive. @@ -114,7 +113,7 @@ NLM_THREAD_NAME = Mod_cgi Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -140,14 +139,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -175,7 +174,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -217,13 +216,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ cgi_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -250,3 +249,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/generators/NWGNUstatus b/modules/generators/NWGNUstatus index 6e9c1d82..e161e438 100644 --- a/modules/generators/NWGNUstatus +++ b/modules/generators/NWGNUstatus @@ -28,7 +28,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -58,7 +57,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -72,7 +71,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -94,7 +93,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = status +NLM_NAME = status # # This is used by the link '-desc ' directive. @@ -112,7 +111,7 @@ NLM_THREAD_NAME = Status Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -138,14 +137,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -173,7 +172,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -215,13 +214,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ status_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -248,3 +247,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/generators/mod_asis.dsp b/modules/generators/mod_asis.dsp index 0555d301..bad34f09 100644 --- a/modules/generators/mod_asis.dsp +++ b/modules/generators/mod_asis.dsp @@ -52,8 +52,14 @@ 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_asis.so" /base:@..\..\os\win32\BaseAddr.ref,mod_asis.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_asis.so" /base:@..\..\os\win32\BaseAddr.ref,mod_asis.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_asis.so" /base:@..\..\os\win32\BaseAddr.ref,mod_asis.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_asis.so" /base:@..\..\os\win32\BaseAddr.ref,mod_asis.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_asis.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_asis - Win32 Debug" @@ -78,8 +84,14 @@ 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_asis.so" /base:@..\..\os\win32\BaseAddr.ref,mod_asis.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_asis.so" /base:@..\..\os\win32\BaseAddr.ref,mod_asis.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_asis.so" /base:@..\..\os\win32\BaseAddr.ref,mod_asis.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_asis.so" /base:@..\..\os\win32\BaseAddr.ref,mod_asis.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_asis.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 diff --git a/modules/generators/mod_autoindex.c b/modules/generators/mod_autoindex.c index 363ead1a..8d514021 100644 --- a/modules/generators/mod_autoindex.c +++ b/modules/generators/mod_autoindex.c @@ -138,6 +138,8 @@ typedef struct autoindex_config_struct { apr_array_header_t *hdr_list; apr_array_header_t *rdme_list; + char *ctype; + char *charset; } autoindex_config_rec; static char c_by_encoding, c_by_type, c_by_path; @@ -476,6 +478,12 @@ static const char *add_opts(cmd_parms *cmd, void *d, int argc, char *const argv[ d_cfg->desc_adjust = K_NOADJUST; } } + else if (!strncasecmp(w, "Type=", 5)) { + d_cfg->ctype = apr_pstrdup(cmd->pool, &w[5]); + } + else if (!strncasecmp(w, "Charset=", 8)) { + d_cfg->charset = apr_pstrdup(cmd->pool, &w[8]); + } else { return "Invalid directory indexing option"; } @@ -620,6 +628,9 @@ static void *merge_autoindex_configs(apr_pool_t *p, void *basev, void *addv) new->icon_height = add->icon_height ? add->icon_height : base->icon_height; new->icon_width = add->icon_width ? add->icon_width : base->icon_width; + new->ctype = add->ctype ? add->ctype : base->ctype; + new->charset = add->charset ? add->charset : base->charset; + new->alt_list = apr_array_append(p, add->alt_list, base->alt_list); new->ign_list = apr_array_append(p, add->ign_list, base->ign_list); new->hdr_list = apr_array_append(p, add->hdr_list, base->hdr_list); @@ -1971,6 +1982,8 @@ static int index_directory(request_rec *r, char *colargs; char *fullpath; apr_size_t dirpathlen; + char *ctype = "text/html"; + char *charset; if ((status = apr_dir_open(&thedir, name, r->pool)) != APR_SUCCESS) { ap_log_rerror(APLOG_MARK, APLOG_ERR, status, r, @@ -1978,11 +1991,27 @@ static int index_directory(request_rec *r, return HTTP_FORBIDDEN; } + if (autoindex_conf->ctype) { + ctype = autoindex_conf->ctype; + } + if (autoindex_conf->charset) { + charset = autoindex_conf->charset; + } + else { #if APR_HAS_UNICODE_FS - ap_set_content_type(r, "text/html;charset=utf-8"); + charset = "UTF-8"; #else - ap_set_content_type(r, "text/html"); + charset = "ISO-8859-1"; #endif + } + if (*charset) { + ap_set_content_type(r, apr_pstrcat(r->pool, ctype, ";charset=", + charset, NULL)); + } + else { + ap_set_content_type(r, ctype); + } + if (autoindex_opts & TRACK_MODIFIED) { ap_update_mtime(r, r->finfo.mtime); ap_set_last_modified(r); diff --git a/modules/generators/mod_autoindex.dsp b/modules/generators/mod_autoindex.dsp index cbde9e73..1f6ec059 100644 --- a/modules/generators/mod_autoindex.dsp +++ b/modules/generators/mod_autoindex.dsp @@ -52,8 +52,14 @@ 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_autoindex.so" /base:@..\..\os\win32\BaseAddr.ref,mod_autoindex.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_autoindex.so" /base:@..\..\os\win32\BaseAddr.ref,mod_autoindex.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_autoindex.so" /base:@..\..\os\win32\BaseAddr.ref,mod_autoindex.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_autoindex.so" /base:@..\..\os\win32\BaseAddr.ref,mod_autoindex.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_autoindex.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_autoindex - Win32 Debug" @@ -78,8 +84,14 @@ 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_autoindex.so" /base:@..\..\os\win32\BaseAddr.ref,mod_autoindex.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_autoindex.so" /base:@..\..\os\win32\BaseAddr.ref,mod_autoindex.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_autoindex.so" /base:@..\..\os\win32\BaseAddr.ref,mod_autoindex.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_autoindex.so" /base:@..\..\os\win32\BaseAddr.ref,mod_autoindex.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_autoindex.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 diff --git a/modules/generators/mod_cgi.c b/modules/generators/mod_cgi.c index 133e18eb..f9980f9d 100644 --- a/modules/generators/mod_cgi.c +++ b/modules/generators/mod_cgi.c @@ -926,14 +926,30 @@ static int cgi_handler(request_rec *r) if ((ret = ap_scan_script_header_err_brigade(r, bb, sbuf))) { ret = log_script(r, conf, ret, dbuf, sbuf, bb, script_err); - /* Set our status. */ - r->status = ret; - - /* Pass EOS bucket down the filter chain. */ - apr_brigade_cleanup(bb); - b = apr_bucket_eos_create(c->bucket_alloc); - APR_BRIGADE_INSERT_TAIL(bb, b); - ap_pass_brigade(r->output_filters, bb); + /* + * ret could be HTTP_NOT_MODIFIED in the case that the CGI script + * does not set an explicit status and ap_meets_conditions, which + * is called by ap_scan_script_header_err_brigade, detects that + * the conditions of the requests are met and the response is + * not modified. + * In this case set r->status and return OK in order to prevent + * running through the error processing stack as this would + * break with mod_cache, if the conditions had been set by + * mod_cache itself to validate a stale entity. + * BTW: We circumvent the error processing stack anyway if the + * CGI script set an explicit status code (whatever it is) and + * the only possible values for ret here are: + * + * HTTP_NOT_MODIFIED (set by ap_meets_conditions) + * HTTP_PRECONDITION_FAILED (set by ap_meets_conditions) + * HTTP_INTERNAL_SERVER_ERROR (if something went wrong during the + * processing of the response of the CGI script, e.g broken headers + * or a crashed CGI process). + */ + if (ret == HTTP_NOT_MODIFIED) { + r->status = ret; + return OK; + } return ret; } diff --git a/modules/generators/mod_cgi.dsp b/modules/generators/mod_cgi.dsp index b803bf5b..4fe58e04 100644 --- a/modules/generators/mod_cgi.dsp +++ b/modules/generators/mod_cgi.dsp @@ -52,8 +52,14 @@ 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_cgi.so" /base:@..\..\os\win32\BaseAddr.ref,mod_cgi.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_cgi.so" /base:@..\..\os\win32\BaseAddr.ref,mod_cgi.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_cgi.so" /base:@..\..\os\win32\BaseAddr.ref,mod_cgi.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_cgi.so" /base:@..\..\os\win32\BaseAddr.ref,mod_cgi.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_cgi.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_cgi - Win32 Debug" @@ -78,8 +84,14 @@ 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_cgi.so" /base:@..\..\os\win32\BaseAddr.ref,mod_cgi.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_cgi.so" /base:@..\..\os\win32\BaseAddr.ref,mod_cgi.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_cgi.so" /base:@..\..\os\win32\BaseAddr.ref,mod_cgi.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_cgi.so" /base:@..\..\os\win32\BaseAddr.ref,mod_cgi.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_cgi.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 diff --git a/modules/generators/mod_cgid.c b/modules/generators/mod_cgid.c index 2dc3eca1..db5c5048 100644 --- a/modules/generators/mod_cgid.c +++ b/modules/generators/mod_cgid.c @@ -1467,7 +1467,34 @@ static int cgid_handler(request_rec *r) APR_BRIGADE_INSERT_TAIL(bb, b); if ((ret = ap_scan_script_header_err_brigade(r, bb, sbuf))) { - return log_script(r, conf, ret, dbuf, sbuf, bb, NULL); + ret = log_script(r, conf, ret, dbuf, sbuf, bb, NULL); + + /* + * ret could be HTTP_NOT_MODIFIED in the case that the CGI script + * does not set an explicit status and ap_meets_conditions, which + * is called by ap_scan_script_header_err_brigade, detects that + * the conditions of the requests are met and the response is + * not modified. + * In this case set r->status and return OK in order to prevent + * running through the error processing stack as this would + * break with mod_cache, if the conditions had been set by + * mod_cache itself to validate a stale entity. + * BTW: We circumvent the error processing stack anyway if the + * CGI script set an explicit status code (whatever it is) and + * the only possible values for ret here are: + * + * HTTP_NOT_MODIFIED (set by ap_meets_conditions) + * HTTP_PRECONDITION_FAILED (set by ap_meets_conditions) + * HTTP_INTERNAL_SERVER_ERROR (if something went wrong during the + * processing of the response of the CGI script, e.g broken headers + * or a crashed CGI process). + */ + if (ret == HTTP_NOT_MODIFIED) { + r->status = ret; + return OK; + } + + return ret; } location = apr_table_get(r->headers_out, "Location"); diff --git a/modules/generators/mod_info.c b/modules/generators/mod_info.c index 7386bb00..adc34150 100644 --- a/modules/generators/mod_info.c +++ b/modules/generators/mod_info.c @@ -721,7 +721,7 @@ static int display_info(request_rec * r) ap_escape_html(r->pool, cmd->name), cmd->name[0] == '<' ? ">" : ""); if (cmd->errmsg) { - ap_rputs(cmd->errmsg, r); + ap_rputs(ap_escape_html(r->pool, cmd->errmsg), r); } ap_rputs("</i></tt></dd>\n", r); } diff --git a/modules/generators/mod_info.dsp b/modules/generators/mod_info.dsp index ff1013d3..524ebf87 100644 --- a/modules/generators/mod_info.dsp +++ b/modules/generators/mod_info.dsp @@ -52,8 +52,14 @@ 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_info.so" /base:@..\..\os\win32\BaseAddr.ref,mod_info.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_info.so" /base:@..\..\os\win32\BaseAddr.ref,mod_info.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_info.so" /base:@..\..\os\win32\BaseAddr.ref,mod_info.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_info.so" /base:@..\..\os\win32\BaseAddr.ref,mod_info.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_info.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_info - Win32 Debug" @@ -78,8 +84,14 @@ 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_info.so" /base:@..\..\os\win32\BaseAddr.ref,mod_info.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_info.so" /base:@..\..\os\win32\BaseAddr.ref,mod_info.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_info.so" /base:@..\..\os\win32\BaseAddr.ref,mod_info.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_info.so" /base:@..\..\os\win32\BaseAddr.ref,mod_info.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_info.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 diff --git a/modules/generators/mod_status.c b/modules/generators/mod_status.c index 7fb0f332..b2a6ea28 100644 --- a/modules/generators/mod_status.c +++ b/modules/generators/mod_status.c @@ -270,7 +270,7 @@ static int status_handler(request_rec *r) if (r->method_number != M_GET) return DECLINED; - ap_set_content_type(r, "text/html"); + ap_set_content_type(r, "text/html; charset=ISO-8859-1"); /* * Simple table-driven form data set parser that lets you alter the header @@ -299,7 +299,7 @@ static int status_handler(request_rec *r) no_table_report = 1; break; case STAT_OPT_AUTO: - ap_set_content_type(r, "text/plain"); + ap_set_content_type(r, "text/plain; charset=ISO-8859-1"); short_report = 1; break; } @@ -673,7 +673,8 @@ static int status_handler(request_rec *r) ap_escape_html(r->pool, ws_record->client), ap_escape_html(r->pool, - ws_record->request), + ap_escape_logitem(r->pool, + ws_record->request)), ap_escape_html(r->pool, ws_record->vhost)); } @@ -763,7 +764,8 @@ static int status_handler(request_rec *r) ap_escape_html(r->pool, ws_record->vhost), ap_escape_html(r->pool, - ws_record->request)); + ap_escape_logitem(r->pool, + ws_record->request))); } /* no_table_report */ } /* for (j...) */ } /* for (i...) */ diff --git a/modules/generators/mod_status.dsp b/modules/generators/mod_status.dsp index 61ef223c..45966401 100644 --- a/modules/generators/mod_status.dsp +++ b/modules/generators/mod_status.dsp @@ -52,8 +52,14 @@ 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_status.so" /base:@..\..\os\win32\BaseAddr.ref,mod_status.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_status.so" /base:@..\..\os\win32\BaseAddr.ref,mod_status.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_status.so" /base:@..\..\os\win32\BaseAddr.ref,mod_status.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_status.so" /base:@..\..\os\win32\BaseAddr.ref,mod_status.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_status.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_status - Win32 Debug" @@ -78,8 +84,14 @@ 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_status.so" /base:@..\..\os\win32\BaseAddr.ref,mod_status.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_status.so" /base:@..\..\os\win32\BaseAddr.ref,mod_status.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_status.so" /base:@..\..\os\win32\BaseAddr.ref,mod_status.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_status.so" /base:@..\..\os\win32\BaseAddr.ref,mod_status.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_status.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 diff --git a/modules/http/http_filters.c b/modules/http/http_filters.c index 6df4edf6..185f50f8 100644 --- a/modules/http/http_filters.c +++ b/modules/http/http_filters.c @@ -721,22 +721,37 @@ static void basic_http_header(request_rec *r, apr_bucket_brigade *bb, apr_brigade_writev(bb, NULL, NULL, vec, 4); #endif - date = apr_palloc(r->pool, APR_RFC822_DATE_LEN); - ap_recent_rfc822_date(date, r->request_time); - h.pool = r->pool; h.bb = bb; - form_header_field(&h, "Date", date); - /* keep the set-by-proxy server header, otherwise - * generate a new server header */ + /* + * keep the set-by-proxy server and date headers, otherwise + * generate a new server header / date header + */ if (r->proxyreq != PROXYREQ_NONE) { + const char *proxy_date; + + proxy_date = apr_table_get(r->headers_out, "Date"); + if (!proxy_date) { + /* + * proxy_date needs to be const. So use date for the creation of + * our own Date header and pass it over to proxy_date later to + * avoid a compiler warning. + */ + date = apr_palloc(r->pool, APR_RFC822_DATE_LEN); + ap_recent_rfc822_date(date, r->request_time); + proxy_date = date; + } + form_header_field(&h, "Date", proxy_date); server = apr_table_get(r->headers_out, "Server"); if (server) { form_header_field(&h, "Server", server); } } else { + date = apr_palloc(r->pool, APR_RFC822_DATE_LEN); + ap_recent_rfc822_date(date, r->request_time); + form_header_field(&h, "Date", date); form_header_field(&h, "Server", ap_get_server_banner()); } diff --git a/modules/http/mod_mime.dsp b/modules/http/mod_mime.dsp index 28a854c9..71ba2ad7 100644 --- a/modules/http/mod_mime.dsp +++ b/modules/http/mod_mime.dsp @@ -52,8 +52,14 @@ 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_mime.so" /base:@..\..\os\win32\BaseAddr.ref,mod_mime.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_mime.so" /base:@..\..\os\win32\BaseAddr.ref,mod_mime.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_mime.so" /base:@..\..\os\win32\BaseAddr.ref,mod_mime.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_mime.so" /base:@..\..\os\win32\BaseAddr.ref,mod_mime.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_mime.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_mime - Win32 Debug" @@ -78,8 +84,14 @@ 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_mime.so" /base:@..\..\os\win32\BaseAddr.ref,mod_mime.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_mime.so" /base:@..\..\os\win32\BaseAddr.ref,mod_mime.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_mime.so" /base:@..\..\os\win32\BaseAddr.ref,mod_mime.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_mime.so" /base:@..\..\os\win32\BaseAddr.ref,mod_mime.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_mime.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 diff --git a/modules/ldap/NWGNUmakefile b/modules/ldap/NWGNUmakefile index 86570695..ad7956e6 100644 --- a/modules/ldap/NWGNUmakefile +++ b/modules/ldap/NWGNUmakefile @@ -28,7 +28,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -66,7 +65,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -80,7 +79,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -102,7 +101,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = utilldap +NLM_NAME = utilldap # # This is used by the link '-desc ' directive. @@ -120,7 +119,7 @@ NLM_THREAD_NAME = UtilLDAP Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -146,14 +145,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -183,7 +182,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -229,13 +228,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ ldap_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -250,7 +249,7 @@ nlms :: libs $(TARGET_nlm) # correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) # install :: nlms FORCE - copy $(OBJDIR)\*.nlm $(INSTALL)\Apache2\modules\*.* + copy $(OBJDIR)\*.nlm $(INSTALL)\$(BASEDIR)\modules\*.* # # Any specialized rules here @@ -263,3 +262,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/ldap/mod_ldap.dsp b/modules/ldap/mod_ldap.dsp index e956d6c2..bacb8ce6 100644 --- a/modules/ldap/mod_ldap.dsp +++ b/modules/ldap/mod_ldap.dsp @@ -52,8 +52,14 @@ 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_ldap.so" /base:@..\..\os\win32\BaseAddr.ref,mod_ldap.so -# ADD LINK32 kernel32.lib wldap32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_ldap.so" /base:@..\..\os\win32\BaseAddr.ref,mod_ldap.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_ldap.so" /base:@..\..\os\win32\BaseAddr.ref,mod_ldap.so +# ADD LINK32 kernel32.lib wldap32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_ldap.so" /base:@..\..\os\win32\BaseAddr.ref,mod_ldap.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_ldap.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_ldap - Win32 Debug" @@ -78,8 +84,14 @@ 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_ldap.so" /base:@..\..\os\win32\BaseAddr.ref,mod_ldap.so -# ADD LINK32 kernel32.lib wldap32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_ldap.so" /base:@..\..\os\win32\BaseAddr.ref,mod_ldap.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_ldap.so" /base:@..\..\os\win32\BaseAddr.ref,mod_ldap.so +# ADD LINK32 kernel32.lib wldap32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_ldap.so" /base:@..\..\os\win32\BaseAddr.ref,mod_ldap.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_ldap.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 diff --git a/modules/ldap/util_ldap.c b/modules/ldap/util_ldap.c index b13bb9e5..d6f8c78b 100644 --- a/modules/ldap/util_ldap.c +++ b/modules/ldap/util_ldap.c @@ -52,6 +52,14 @@ #define LDAP_CA_TYPE_BASE64 2 #define LDAP_CA_TYPE_CERT7_DB 3 +/* Default define for ldap functions that need a SIZELIMIT but + * do not have the define + * XXX This should be removed once a supporting #define is + * released through APR-Util. + */ +#ifndef APR_LDAP_SIZELIMIT +#define APR_LDAP_SIZELIMIT -1 +#endif module AP_MODULE_DECLARE_DATA ldap_module; @@ -201,7 +209,7 @@ static apr_status_t uldap_connection_cleanup(void *param) static int uldap_connection_init(request_rec *r, util_ldap_connection_t *ldc ) { - int rc = 0; + int rc = 0, ldap_option = 0; int version = LDAP_VERSION3; apr_ldap_err_t *result = NULL; struct timeval timeOut = {10,0}; /* 10 second connection timeout */ @@ -264,7 +272,8 @@ static int uldap_connection_init(request_rec *r, } /* Set the alias dereferencing option */ - ldap_set_option(ldc->ldap, LDAP_OPT_DEREF, &(ldc->deref)); + ldap_option = ldc->deref; + ldap_set_option(ldc->ldap, LDAP_OPT_DEREF, &ldap_option); /*XXX All of the #ifdef's need to be removed once apr-util 1.2 is released */ #ifdef APR_LDAP_OPT_VERIFY_CERT @@ -656,7 +665,7 @@ start_over: /* search for reqdn */ if ((result = ldap_search_ext_s(ldc->ldap, (char *)reqdn, LDAP_SCOPE_BASE, "(objectclass=*)", NULL, 1, - NULL, NULL, NULL, -1, &res)) + NULL, NULL, NULL, APR_LDAP_SIZELIMIT, &res)) == LDAP_SERVER_DOWN) { ldc->reason = "DN Comparison ldap_search_ext_s() " @@ -934,7 +943,7 @@ start_over: if ((result = ldap_search_ext_s(ldc->ldap, (char *)basedn, scope, (char *)filter, attrs, 0, - NULL, NULL, NULL, -1, &res)) + NULL, NULL, NULL, APR_LDAP_SIZELIMIT, &res)) == LDAP_SERVER_DOWN) { ldc->reason = "ldap_search_ext_s() for user failed with server down"; @@ -1174,7 +1183,7 @@ start_over: if ((result = ldap_search_ext_s(ldc->ldap, (char *)basedn, scope, (char *)filter, attrs, 0, - NULL, NULL, NULL, -1, &res)) + NULL, NULL, NULL, APR_LDAP_SIZELIMIT, &res)) == LDAP_SERVER_DOWN) { ldc->reason = "ldap_search_ext_s() for user failed with server down"; @@ -1814,6 +1823,7 @@ static void *util_ldap_merge_config(apr_pool_t *p, void *basev, st->search_cache_size = base->search_cache_size; st->compare_cache_ttl = base->compare_cache_ttl; st->compare_cache_size = base->compare_cache_size; + st->util_ldap_cache_lock = base->util_ldap_cache_lock; st->connections = NULL; st->ssl_supported = 0; diff --git a/modules/loggers/NWGNUforensic b/modules/loggers/NWGNUforensic index 58bbbcee..18851819 100644 --- a/modules/loggers/NWGNUforensic +++ b/modules/loggers/NWGNUforensic @@ -36,7 +36,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -66,7 +65,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -80,7 +79,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -102,7 +101,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = forensic +NLM_NAME = forensic # # This is used by the link '-desc ' directive. @@ -120,7 +119,7 @@ NLM_THREAD_NAME = Forensic Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -146,14 +145,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -181,7 +180,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -223,13 +222,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ log_forensic_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -244,7 +243,7 @@ nlms :: libs $(TARGET_nlm) # correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) # install :: nlms FORCE - copy $(OBJDIR)\*.nlm $(INSTALL)\Apache2\modules\*.* + copy $(OBJDIR)\*.nlm $(INSTALL)\$(BASEDIR)\modules\*.* # # Any specialized rules here @@ -258,4 +257,3 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc - diff --git a/modules/loggers/NWGNUmakefile b/modules/loggers/NWGNUmakefile index 9c42c52f..219e13fe 100644 --- a/modules/loggers/NWGNUmakefile +++ b/modules/loggers/NWGNUmakefile @@ -59,7 +59,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -73,7 +73,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -95,7 +95,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = +NLM_NAME = # # This is used by the link '-desc ' directive. @@ -113,7 +113,7 @@ NLM_THREAD_NAME = # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -139,14 +139,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = +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 = +XDCDATA = # # If there is an NLM target, put it here @@ -209,13 +209,13 @@ FILES_nlm_Ximports = \ # 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) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -230,7 +230,7 @@ nlms :: libs $(TARGET_nlm) # correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) # install :: nlms FORCE - copy $(OBJDIR)\*.nlm $(INSTALL)\Apache2\modules\*.* + copy $(OBJDIR)\*.nlm $(INSTALL)\$(BASEDIR)\modules\*.* # # Any specialized rules here @@ -244,4 +244,3 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc - diff --git a/modules/loggers/NWGNUmodlogio b/modules/loggers/NWGNUmodlogio index 77f42d52..80ac8041 100644 --- a/modules/loggers/NWGNUmodlogio +++ b/modules/loggers/NWGNUmodlogio @@ -36,7 +36,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -66,7 +65,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -80,7 +79,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -102,7 +101,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = logio +NLM_NAME = logio # # This is used by the link '-desc ' directive. @@ -120,7 +119,7 @@ NLM_THREAD_NAME = Logio Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -146,14 +145,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -181,7 +180,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -223,13 +222,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ logio_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -244,7 +243,7 @@ nlms :: libs $(TARGET_nlm) # correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) # install :: nlms FORCE - copy $(OBJDIR)\*.nlm $(INSTALL)\Apache2\modules\*.* + copy $(OBJDIR)\*.nlm $(INSTALL)\$(BASEDIR)\modules\*.* # # Any specialized rules here @@ -258,4 +257,3 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc - diff --git a/modules/loggers/mod_log_config.dsp b/modules/loggers/mod_log_config.dsp index 09ef0238..2338875c 100644 --- a/modules/loggers/mod_log_config.dsp +++ b/modules/loggers/mod_log_config.dsp @@ -52,8 +52,14 @@ 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_log_config.so" /base:@..\..\os\win32\BaseAddr.ref,mod_log_config.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_log_config.so" /base:@..\..\os\win32\BaseAddr.ref,mod_log_config.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_log_config.so" /base:@..\..\os\win32\BaseAddr.ref,mod_log_config.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_log_config.so" /base:@..\..\os\win32\BaseAddr.ref,mod_log_config.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_log_config.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_log_config - Win32 Debug" @@ -78,8 +84,14 @@ 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_log_config.so" /base:@..\..\os\win32\BaseAddr.ref,mod_log_config.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_log_config.so" /base:@..\..\os\win32\BaseAddr.ref,mod_log_config.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_log_config.so" /base:@..\..\os\win32\BaseAddr.ref,mod_log_config.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_log_config.so" /base:@..\..\os\win32\BaseAddr.ref,mod_log_config.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_log_config.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 diff --git a/modules/loggers/mod_log_forensic.dsp b/modules/loggers/mod_log_forensic.dsp index 7aa822b3..cdf7c21e 100644 --- a/modules/loggers/mod_log_forensic.dsp +++ b/modules/loggers/mod_log_forensic.dsp @@ -52,8 +52,14 @@ 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_log_forensic.so" /base:@..\..\os\win32\BaseAddr.ref,mod_log_forensic.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_log_forensic.so" /base:@..\..\os\win32\BaseAddr.ref,mod_log_forensic.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_log_forensic.so" /base:@..\..\os\win32\BaseAddr.ref,mod_log_forensic.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_log_forensic.so" /base:@..\..\os\win32\BaseAddr.ref,mod_log_forensic.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_log_forensic.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_log_forensic - Win32 Debug" @@ -78,8 +84,14 @@ 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_log_forensic.so" /base:@..\..\os\win32\BaseAddr.ref,mod_log_forensic.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_log_forensic.so" /base:@..\..\os\win32\BaseAddr.ref,mod_log_forensic.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_log_forensic.so" /base:@..\..\os\win32\BaseAddr.ref,mod_log_forensic.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_log_forensic.so" /base:@..\..\os\win32\BaseAddr.ref,mod_log_forensic.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_log_forensic.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 diff --git a/modules/loggers/mod_logio.dsp b/modules/loggers/mod_logio.dsp index cf4c671d..f5a81865 100644 --- a/modules/loggers/mod_logio.dsp +++ b/modules/loggers/mod_logio.dsp @@ -52,8 +52,14 @@ 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_logio.so" /base:@..\..\os\win32\BaseAddr.ref,mod_logio.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_logio.so" /base:@..\..\os\win32\BaseAddr.ref,mod_logio.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_logio.so" /base:@..\..\os\win32\BaseAddr.ref,mod_logio.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_logio.so" /base:@..\..\os\win32\BaseAddr.ref,mod_logio.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_logio.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_logio - Win32 Debug" @@ -78,8 +84,14 @@ 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_logio.so" /base:@..\..\os\win32\BaseAddr.ref,mod_logio.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_logio.so" /base:@..\..\os\win32\BaseAddr.ref,mod_logio.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_logio.so" /base:@..\..\os\win32\BaseAddr.ref,mod_logio.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_logio.so" /base:@..\..\os\win32\BaseAddr.ref,mod_logio.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_logio.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 diff --git a/modules/mappers/NWGNUactions b/modules/mappers/NWGNUactions index 479e4ff2..6594ad62 100644 --- a/modules/mappers/NWGNUactions +++ b/modules/mappers/NWGNUactions @@ -57,7 +57,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -71,7 +71,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -93,7 +93,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = actions +NLM_NAME = actions # # This is used by the link '-desc ' directive. @@ -111,7 +111,7 @@ NLM_THREAD_NAME = Actions Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -137,14 +137,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -172,7 +172,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -214,13 +214,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ actions_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -247,3 +247,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/mappers/NWGNUimagemap b/modules/mappers/NWGNUimagemap index dbce0cb1..087b490c 100644 --- a/modules/mappers/NWGNUimagemap +++ b/modules/mappers/NWGNUimagemap @@ -58,7 +58,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -72,7 +72,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -94,7 +94,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = imagemap +NLM_NAME = imagemap # # This is used by the link '-desc ' directive. @@ -112,7 +112,7 @@ NLM_THREAD_NAME = Image Map Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -138,14 +138,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -173,7 +173,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -215,13 +215,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ imagemap_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -248,3 +248,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/mappers/NWGNUmakefile b/modules/mappers/NWGNUmakefile index ba7b3903..35e0f825 100644 --- a/modules/mappers/NWGNUmakefile +++ b/modules/mappers/NWGNUmakefile @@ -59,7 +59,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -73,7 +73,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -95,7 +95,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = +NLM_NAME = # # This is used by the link '-desc ' directive. @@ -113,7 +113,7 @@ NLM_THREAD_NAME = # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -139,14 +139,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = +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 = +XDCDATA = # # If there is an NLM target, put it here @@ -213,13 +213,13 @@ FILES_nlm_Ximports = \ # 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) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -234,7 +234,7 @@ nlms :: libs $(TARGET_nlm) # correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) # install :: nlms FORCE - copy $(OBJDIR)\*.nlm $(INSTALL)\Apache2\modules\*.* + copy $(OBJDIR)\*.nlm $(INSTALL)\$(BASEDIR)\modules\*.* # # Any specialized rules here diff --git a/modules/mappers/NWGNUrewrite b/modules/mappers/NWGNUrewrite index 153a2410..e3c378f1 100644 --- a/modules/mappers/NWGNUrewrite +++ b/modules/mappers/NWGNUrewrite @@ -58,7 +58,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -72,7 +72,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -94,7 +94,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = rewrite +NLM_NAME = rewrite # # This is used by the link '-desc ' directive. @@ -112,7 +112,7 @@ NLM_THREAD_NAME = Rewrite Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -138,14 +138,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -173,7 +173,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -215,13 +215,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ rewrite_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -248,3 +248,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/mappers/NWGNUspeling b/modules/mappers/NWGNUspeling index 16c6677d..da1638ba 100644 --- a/modules/mappers/NWGNUspeling +++ b/modules/mappers/NWGNUspeling @@ -57,7 +57,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -71,7 +71,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -93,7 +93,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = speling +NLM_NAME = speling # # This is used by the link '-desc ' directive. @@ -111,7 +111,7 @@ NLM_THREAD_NAME = Speling Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -137,14 +137,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -172,7 +172,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -214,13 +214,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ speling_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -247,3 +247,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/mappers/NWGNUuserdir b/modules/mappers/NWGNUuserdir index a8abfdd3..7f5ef020 100644 --- a/modules/mappers/NWGNUuserdir +++ b/modules/mappers/NWGNUuserdir @@ -58,7 +58,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -72,7 +72,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -94,7 +94,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = userdir +NLM_NAME = userdir # # This is used by the link '-desc ' directive. @@ -112,7 +112,7 @@ NLM_THREAD_NAME = UserDir Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -138,14 +138,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -173,7 +173,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -215,13 +215,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ userdir_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -248,3 +248,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/mappers/NWGNUvhost b/modules/mappers/NWGNUvhost index 9f0bad4f..a2f7eff2 100644 --- a/modules/mappers/NWGNUvhost +++ b/modules/mappers/NWGNUvhost @@ -57,7 +57,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -71,7 +71,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -93,7 +93,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = vhost +NLM_NAME = vhost # # This is used by the link '-desc ' directive. @@ -111,7 +111,7 @@ NLM_THREAD_NAME = Vhost Alias Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -137,14 +137,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -172,7 +172,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -214,13 +214,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ vhost_alias_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -247,3 +247,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/mappers/mod_actions.dsp b/modules/mappers/mod_actions.dsp index d7d316fe..736937c7 100644 --- a/modules/mappers/mod_actions.dsp +++ b/modules/mappers/mod_actions.dsp @@ -52,8 +52,14 @@ 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_actions.so" /base:@..\..\os\win32\BaseAddr.ref,mod_actions.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_actions.so" /base:@..\..\os\win32\BaseAddr.ref,mod_actions.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_actions.so" /base:@..\..\os\win32\BaseAddr.ref,mod_actions.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_actions.so" /base:@..\..\os\win32\BaseAddr.ref,mod_actions.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_actions.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_actions - Win32 Debug" @@ -78,8 +84,14 @@ 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_actions.so" /base:@..\..\os\win32\BaseAddr.ref,mod_actions.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_actions.so" /base:@..\..\os\win32\BaseAddr.ref,mod_actions.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_actions.so" /base:@..\..\os\win32\BaseAddr.ref,mod_actions.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_actions.so" /base:@..\..\os\win32\BaseAddr.ref,mod_actions.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_actions.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 diff --git a/modules/mappers/mod_alias.c b/modules/mappers/mod_alias.c index b0a25177..bde1703d 100644 --- a/modules/mappers/mod_alias.c +++ b/modules/mappers/mod_alias.c @@ -204,7 +204,10 @@ static const char *add_redirect_internal(cmd_parms *cmd, if (ap_is_HTTP_REDIRECT(status)) { if (!url) return "URL to redirect to is missing"; - if (!use_regex && !ap_is_url(url)) + /* PR#35314: we can allow path components here; + * they get correctly resolved to full URLs. + */ + if (!use_regex && !ap_is_url(url) && (url[0] != '/')) return "Redirect to non-URL"; } else { diff --git a/modules/mappers/mod_alias.dsp b/modules/mappers/mod_alias.dsp index 6999888d..4c8cf84f 100644 --- a/modules/mappers/mod_alias.dsp +++ b/modules/mappers/mod_alias.dsp @@ -52,8 +52,14 @@ 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_alias.so" /base:@..\..\os\win32\BaseAddr.ref,mod_alias.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_alias.so" /base:@..\..\os\win32\BaseAddr.ref,mod_alias.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_alias.so" /base:@..\..\os\win32\BaseAddr.ref,mod_alias.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_alias.so" /base:@..\..\os\win32\BaseAddr.ref,mod_alias.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_alias.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_alias - Win32 Debug" @@ -78,8 +84,14 @@ 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_alias.so" /base:@..\..\os\win32\BaseAddr.ref,mod_alias.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_alias.so" /base:@..\..\os\win32\BaseAddr.ref,mod_alias.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_alias.so" /base:@..\..\os\win32\BaseAddr.ref,mod_alias.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_alias.so" /base:@..\..\os\win32\BaseAddr.ref,mod_alias.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_alias.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 diff --git a/modules/mappers/mod_dir.dsp b/modules/mappers/mod_dir.dsp index 4fe9de8d..cc9ebdbe 100644 --- a/modules/mappers/mod_dir.dsp +++ b/modules/mappers/mod_dir.dsp @@ -52,8 +52,14 @@ 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_dir.so" /base:@..\..\os\win32\BaseAddr.ref,mod_dir.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_dir.so" /base:@..\..\os\win32\BaseAddr.ref,mod_dir.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_dir.so" /base:@..\..\os\win32\BaseAddr.ref,mod_dir.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_dir.so" /base:@..\..\os\win32\BaseAddr.ref,mod_dir.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_dir.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_dir - Win32 Debug" @@ -78,8 +84,14 @@ 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_dir.so" /base:@..\..\os\win32\BaseAddr.ref,mod_dir.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_dir.so" /base:@..\..\os\win32\BaseAddr.ref,mod_dir.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_dir.so" /base:@..\..\os\win32\BaseAddr.ref,mod_dir.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_dir.so" /base:@..\..\os\win32\BaseAddr.ref,mod_dir.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_dir.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 diff --git a/modules/mappers/mod_imagemap.dsp b/modules/mappers/mod_imagemap.dsp index cec33e3a..88a85c86 100644 --- a/modules/mappers/mod_imagemap.dsp +++ b/modules/mappers/mod_imagemap.dsp @@ -52,8 +52,14 @@ 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_imagemap.so" /base:@..\..\os\win32\BaseAddr.ref,mod_imagemap.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_imagemap.so" /base:@..\..\os\win32\BaseAddr.ref,mod_imagemap.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_imagemap.so" /base:@..\..\os\win32\BaseAddr.ref,mod_imagemap.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_imagemap.so" /base:@..\..\os\win32\BaseAddr.ref,mod_imagemap.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_imagemap.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_imagemap - Win32 Debug" @@ -78,8 +84,14 @@ 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_imagemap.so" /base:@..\..\os\win32\BaseAddr.ref,mod_imagemap.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_imagemap.so" /base:@..\..\os\win32\BaseAddr.ref,mod_imagemap.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_imagemap.so" /base:@..\..\os\win32\BaseAddr.ref,mod_imagemap.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_imagemap.so" /base:@..\..\os\win32\BaseAddr.ref,mod_imagemap.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_imagemap.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 diff --git a/modules/mappers/mod_negotiation.c b/modules/mappers/mod_negotiation.c index 8c54fa72..c9fff1e5 100644 --- a/modules/mappers/mod_negotiation.c +++ b/modules/mappers/mod_negotiation.c @@ -2971,6 +2971,7 @@ static int handle_map_file(request_rec *r) var_rec *best; int res; char *udir; + const char *new_req; if(strcmp(r->handler,MAP_FILE_MAGIC_TYPE) && strcmp(r->handler,"type-map")) return DECLINED; @@ -3062,8 +3063,21 @@ static int handle_map_file(request_rec *r) } udir = ap_make_dirstr_parent(r->pool, r->uri); udir = ap_escape_uri(r->pool, udir); - ap_internal_redirect(apr_pstrcat(r->pool, udir, best->file_name, - r->path_info, NULL), r); + if (r->args) { + if (r->path_info) { + new_req = apr_pstrcat(r->pool, udir, best->file_name, + r->path_info, "?", r->args, NULL); + } + else { + new_req = apr_pstrcat(r->pool, udir, best->file_name, + "?", r->args, NULL); + } + } + else { + new_req = apr_pstrcat(r->pool, udir, best->file_name, + r->path_info, NULL); + } + ap_internal_redirect(new_req, r); return OK; } diff --git a/modules/mappers/mod_negotiation.dsp b/modules/mappers/mod_negotiation.dsp index 30221783..4f24316a 100644 --- a/modules/mappers/mod_negotiation.dsp +++ b/modules/mappers/mod_negotiation.dsp @@ -52,8 +52,14 @@ 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_negotiation.so" /base:@..\..\os\win32\BaseAddr.ref,mod_negotiation.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_negotiation.so" /base:@..\..\os\win32\BaseAddr.ref,mod_negotiation.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_negotiation.so" /base:@..\..\os\win32\BaseAddr.ref,mod_negotiation.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_negotiation.so" /base:@..\..\os\win32\BaseAddr.ref,mod_negotiation.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_negotiation.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_negotiation - Win32 Debug" @@ -78,8 +84,14 @@ 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_negotiation.so" /base:@..\..\os\win32\BaseAddr.ref,mod_negotiation.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_negotiation.so" /base:@..\..\os\win32\BaseAddr.ref,mod_negotiation.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_negotiation.so" /base:@..\..\os\win32\BaseAddr.ref,mod_negotiation.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_negotiation.so" /base:@..\..\os\win32\BaseAddr.ref,mod_negotiation.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_negotiation.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 diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c index 6bd5a95f..39dc11fb 100644 --- a/modules/mappers/mod_rewrite.c +++ b/modules/mappers/mod_rewrite.c @@ -1061,11 +1061,7 @@ static char *rewrite_mapfunc_toupper(request_rec *r, char *key) static char *rewrite_mapfunc_tolower(request_rec *r, char *key) { - char *p; - - for (p = key; *p; ++p) { - *p = apr_tolower(*p); - } + ap_str_tolower(key); return key; } diff --git a/modules/mappers/mod_rewrite.dsp b/modules/mappers/mod_rewrite.dsp index 6d8befea..68de1e23 100644 --- a/modules/mappers/mod_rewrite.dsp +++ b/modules/mappers/mod_rewrite.dsp @@ -52,8 +52,14 @@ 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_rewrite.so" /base:@..\..\os\win32\BaseAddr.ref,mod_rewrite.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_rewrite.so" /base:@..\..\os\win32\BaseAddr.ref,mod_rewrite.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_rewrite.so" /base:@..\..\os\win32\BaseAddr.ref,mod_rewrite.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_rewrite.so" /base:@..\..\os\win32\BaseAddr.ref,mod_rewrite.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_rewrite.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_rewrite - Win32 Debug" @@ -78,8 +84,14 @@ 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_rewrite.so" /base:@..\..\os\win32\BaseAddr.ref,mod_rewrite.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_rewrite.so" /base:@..\..\os\win32\BaseAddr.ref,mod_rewrite.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_rewrite.so" /base:@..\..\os\win32\BaseAddr.ref,mod_rewrite.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_rewrite.so" /base:@..\..\os\win32\BaseAddr.ref,mod_rewrite.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_rewrite.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 diff --git a/modules/mappers/mod_so.c b/modules/mappers/mod_so.c index b95aba54..44bed43b 100644 --- a/modules/mappers/mod_so.c +++ b/modules/mappers/mod_so.c @@ -268,9 +268,12 @@ static const char *load_module(cmd_parms *cmd, void *dummy, * */ if (modp->magic != MODULE_MAGIC_COOKIE) { - return apr_pstrcat(cmd->pool, "API module structure `", modname, - "' in file ", szModuleFile, " is garbled -" - " perhaps this is not an Apache module DSO?", NULL); + return apr_psprintf(cmd->pool, "API module structure '%s' in file %s " + "is garbled - expected signature %08lx but saw " + "%08lx - perhaps this is not an Apache module DSO, " + "or was compiled for a different Apache version?", + modname, szModuleFile, + MODULE_MAGIC_COOKIE, modp->magic); } /* diff --git a/modules/mappers/mod_speling.dsp b/modules/mappers/mod_speling.dsp index 12771d91..d8840b8f 100644 --- a/modules/mappers/mod_speling.dsp +++ b/modules/mappers/mod_speling.dsp @@ -52,8 +52,14 @@ 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_speling.so" /base:@..\..\os\win32\BaseAddr.ref,mod_speling.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_speling.so" /base:@..\..\os\win32\BaseAddr.ref,mod_speling.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_speling.so" /base:@..\..\os\win32\BaseAddr.ref,mod_speling.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_speling.so" /base:@..\..\os\win32\BaseAddr.ref,mod_speling.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_speling.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_speling - Win32 Debug" @@ -78,8 +84,14 @@ 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_speling.so" /base:@..\..\os\win32\BaseAddr.ref,mod_speling.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_speling.so" /base:@..\..\os\win32\BaseAddr.ref,mod_speling.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_speling.so" /base:@..\..\os\win32\BaseAddr.ref,mod_speling.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_speling.so" /base:@..\..\os\win32\BaseAddr.ref,mod_speling.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_speling.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 diff --git a/modules/mappers/mod_userdir.dsp b/modules/mappers/mod_userdir.dsp index 97fe5373..e40367f5 100644 --- a/modules/mappers/mod_userdir.dsp +++ b/modules/mappers/mod_userdir.dsp @@ -52,8 +52,14 @@ 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_userdir.so" /base:@..\..\os\win32\BaseAddr.ref,mod_userdir.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_userdir.so" /base:@..\..\os\win32\BaseAddr.ref,mod_userdir.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_userdir.so" /base:@..\..\os\win32\BaseAddr.ref,mod_userdir.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_userdir.so" /base:@..\..\os\win32\BaseAddr.ref,mod_userdir.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_userdir.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_userdir - Win32 Debug" @@ -78,8 +84,14 @@ 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_userdir.so" /base:@..\..\os\win32\BaseAddr.ref,mod_userdir.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_userdir.so" /base:@..\..\os\win32\BaseAddr.ref,mod_userdir.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_userdir.so" /base:@..\..\os\win32\BaseAddr.ref,mod_userdir.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_userdir.so" /base:@..\..\os\win32\BaseAddr.ref,mod_userdir.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_userdir.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 diff --git a/modules/mappers/mod_vhost_alias.dsp b/modules/mappers/mod_vhost_alias.dsp index 68b3f70c..0273ab41 100644 --- a/modules/mappers/mod_vhost_alias.dsp +++ b/modules/mappers/mod_vhost_alias.dsp @@ -52,8 +52,14 @@ 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_vhost_alias.so" /base:@..\..\os\win32\BaseAddr.ref,mod_vhost_alias.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_vhost_alias.so" /base:@..\..\os\win32\BaseAddr.ref,mod_vhost_alias.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_vhost_alias.so" /base:@..\..\os\win32\BaseAddr.ref,mod_vhost_alias.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_vhost_alias.so" /base:@..\..\os\win32\BaseAddr.ref,mod_vhost_alias.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_vhost_alias.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_vhost_alias - Win32 Debug" @@ -78,8 +84,14 @@ 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_vhost_alias.so" /base:@..\..\os\win32\BaseAddr.ref,mod_vhost_alias.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_vhost_alias.so" /base:@..\..\os\win32\BaseAddr.ref,mod_vhost_alias.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_vhost_alias.so" /base:@..\..\os\win32\BaseAddr.ref,mod_vhost_alias.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_vhost_alias.so" /base:@..\..\os\win32\BaseAddr.ref,mod_vhost_alias.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_vhost_alias.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 diff --git a/modules/metadata/NWGNUcernmeta b/modules/metadata/NWGNUcernmeta index ffcd42a2..f7d65cbf 100644 --- a/modules/metadata/NWGNUcernmeta +++ b/modules/metadata/NWGNUcernmeta @@ -28,7 +28,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -58,7 +57,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -72,7 +71,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -94,7 +93,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = cernmeta +NLM_NAME = cernmeta # # This is used by the link '-desc ' directive. @@ -112,7 +111,7 @@ NLM_THREAD_NAME = CERN Meta Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -138,14 +137,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -173,7 +172,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -215,13 +214,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ cern_meta_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -248,3 +247,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/metadata/NWGNUexpires b/modules/metadata/NWGNUexpires index 5dff127f..e6c9a715 100644 --- a/modules/metadata/NWGNUexpires +++ b/modules/metadata/NWGNUexpires @@ -28,7 +28,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -58,7 +57,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -72,7 +71,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -94,7 +93,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = expires +NLM_NAME = expires # # This is used by the link '-desc ' directive. @@ -112,7 +111,7 @@ NLM_THREAD_NAME = Expires Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -138,14 +137,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -173,7 +172,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -215,13 +214,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ expires_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -248,3 +247,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/metadata/NWGNUheaders b/modules/metadata/NWGNUheaders index 5c788a2f..d68f2967 100644 --- a/modules/metadata/NWGNUheaders +++ b/modules/metadata/NWGNUheaders @@ -29,7 +29,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -59,7 +58,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -73,7 +72,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -95,7 +94,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = headers +NLM_NAME = headers # # This is used by the link '-desc ' directive. @@ -113,7 +112,7 @@ NLM_THREAD_NAME = Headers Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -139,14 +138,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -174,7 +173,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -216,13 +215,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ headers_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -249,3 +248,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/metadata/NWGNUmakefile b/modules/metadata/NWGNUmakefile index 58d1a198..b9361aec 100644 --- a/modules/metadata/NWGNUmakefile +++ b/modules/metadata/NWGNUmakefile @@ -60,7 +60,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -74,7 +74,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -96,7 +96,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = +NLM_NAME = # # This is used by the link '-desc ' directive. @@ -114,7 +114,7 @@ NLM_THREAD_NAME = # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -140,14 +140,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = +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 = +XDCDATA = # # If there is an NLM target, put it here @@ -216,13 +216,13 @@ FILES_nlm_Ximports = \ # 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) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -237,7 +237,7 @@ nlms :: libs $(TARGET_nlm) # correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) # install :: nlms FORCE - copy $(OBJDIR)\*.nlm $(INSTALL)\Apache2\modules\*.* + copy $(OBJDIR)\*.nlm $(INSTALL)\$(BASEDIR)\modules\*.* # # Any specialized rules here diff --git a/modules/metadata/NWGNUmimemagi b/modules/metadata/NWGNUmimemagi index 3c5f11a4..e7c6daad 100644 --- a/modules/metadata/NWGNUmimemagi +++ b/modules/metadata/NWGNUmimemagi @@ -28,7 +28,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -58,7 +57,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -72,7 +71,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -94,7 +93,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = mimemagi +NLM_NAME = mimemagi # # This is used by the link '-desc ' directive. @@ -106,13 +105,13 @@ NLM_DESCRIPTION = Apache $(VERSION_STR) Mime Magic Module # This is used by the '-threadname' directive. If left blank, # NLM_NAME Thread will be used. # -NLM_THREAD_NAME = CERN Meta Module +NLM_THREAD_NAME = minemagic Module # # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -138,14 +137,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -173,7 +172,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -215,13 +214,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ mime_magic_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -248,3 +247,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/metadata/NWGNUmodident b/modules/metadata/NWGNUmodident index 0677b431..dc7ef408 100644 --- a/modules/metadata/NWGNUmodident +++ b/modules/metadata/NWGNUmodident @@ -28,7 +28,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -58,7 +57,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -72,7 +71,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -94,7 +93,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = modident +NLM_NAME = modident # # This is used by the link '-desc ' directive. @@ -112,7 +111,7 @@ NLM_THREAD_NAME = Mod_Ident Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -138,14 +137,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -173,7 +172,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -215,13 +214,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ ident_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -248,3 +247,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/metadata/NWGNUmodversion b/modules/metadata/NWGNUmodversion index 9f97d649..eab2d11e 100644 --- a/modules/metadata/NWGNUmodversion +++ b/modules/metadata/NWGNUmodversion @@ -28,7 +28,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -58,7 +57,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -72,7 +71,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -94,7 +93,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = modversion +NLM_NAME = modversion # # This is used by the link '-desc ' directive. @@ -112,7 +111,7 @@ NLM_THREAD_NAME = Version Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -138,14 +137,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -173,7 +172,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -215,13 +214,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ version_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -248,3 +247,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/metadata/NWGNUuniqueid b/modules/metadata/NWGNUuniqueid index 699ac227..0e4058c2 100644 --- a/modules/metadata/NWGNUuniqueid +++ b/modules/metadata/NWGNUuniqueid @@ -28,7 +28,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -58,7 +57,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -72,7 +71,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -94,7 +93,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = uniqueid +NLM_NAME = uniqueid # # This is used by the link '-desc ' directive. @@ -112,7 +111,7 @@ NLM_THREAD_NAME = Unique ID Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -138,14 +137,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -174,7 +173,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -213,7 +212,7 @@ FILES_nlm_Ximports = \ # Don't link with Winsock if standard sockets are being used ifndef USE_STDSOCKETS FILES_nlm_Ximports += @ws2nlm.imp \ - $(EOLIST) + $(EOLIST) endif # @@ -222,13 +221,13 @@ endif FILES_nlm_exports = \ unique_id_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -257,3 +256,4 @@ vpath %.c ../arch/netware include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/metadata/NWGNUusertrk b/modules/metadata/NWGNUusertrk index 0249a0f9..450bf652 100644 --- a/modules/metadata/NWGNUusertrk +++ b/modules/metadata/NWGNUusertrk @@ -28,7 +28,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -58,7 +57,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -72,7 +71,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -94,7 +93,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = usertrk +NLM_NAME = usertrk # # This is used by the link '-desc ' directive. @@ -112,7 +111,7 @@ NLM_THREAD_NAME = User Track Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -138,14 +137,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -173,7 +172,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -215,7 +214,7 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ usertrack_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character @@ -248,3 +247,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/metadata/mod_cern_meta.dsp b/modules/metadata/mod_cern_meta.dsp index 6f986723..ae36b0dd 100644 --- a/modules/metadata/mod_cern_meta.dsp +++ b/modules/metadata/mod_cern_meta.dsp @@ -52,8 +52,14 @@ 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_cern_meta.so" /base:@..\..\os\win32\BaseAddr.ref,mod_cern_meta.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_cern_meta.so" /base:@..\..\os\win32\BaseAddr.ref,mod_cern_meta.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_cern_meta.so" /base:@..\..\os\win32\BaseAddr.ref,mod_cern_meta.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_cern_meta.so" /base:@..\..\os\win32\BaseAddr.ref,mod_cern_meta.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_cern_meta.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_cern_meta - Win32 Debug" @@ -78,8 +84,14 @@ 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_cern_meta.so" /base:@..\..\os\win32\BaseAddr.ref,mod_cern_meta.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_cern_meta.so" /base:@..\..\os\win32\BaseAddr.ref,mod_cern_meta.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_cern_meta.so" /base:@..\..\os\win32\BaseAddr.ref,mod_cern_meta.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_cern_meta.so" /base:@..\..\os\win32\BaseAddr.ref,mod_cern_meta.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_cern_meta.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 diff --git a/modules/metadata/mod_env.dsp b/modules/metadata/mod_env.dsp index 7cbf5737..9b9bd532 100644 --- a/modules/metadata/mod_env.dsp +++ b/modules/metadata/mod_env.dsp @@ -52,8 +52,14 @@ 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_env.so" /base:@..\..\os\win32\BaseAddr.ref,mod_env.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_env.so" /base:@..\..\os\win32\BaseAddr.ref,mod_env.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_env.so" /base:@..\..\os\win32\BaseAddr.ref,mod_env.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_env.so" /base:@..\..\os\win32\BaseAddr.ref,mod_env.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_env.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_env - Win32 Debug" @@ -78,8 +84,14 @@ 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_env.so" /base:@..\..\os\win32\BaseAddr.ref,mod_env.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_env.so" /base:@..\..\os\win32\BaseAddr.ref,mod_env.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_env.so" /base:@..\..\os\win32\BaseAddr.ref,mod_env.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_env.so" /base:@..\..\os\win32\BaseAddr.ref,mod_env.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_env.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 diff --git a/modules/metadata/mod_expires.c b/modules/metadata/mod_expires.c index caf9b2b7..984ee931 100644 --- a/modules/metadata/mod_expires.c +++ b/modules/metadata/mod_expires.c @@ -321,6 +321,9 @@ static const char *set_expiresbytype(cmd_parms *cmd, void *in_dir_config, const char *check; check = ap_strrchr_c(mime, '/'); + if (check == NULL) { + return "Invalid mimetype: should contain a slash"; + } if ((strlen(++check) == 1) && (*check == '*')) { dir_config->wildcards = 1; } diff --git a/modules/metadata/mod_expires.dsp b/modules/metadata/mod_expires.dsp index 3c51023b..a87dddaf 100644 --- a/modules/metadata/mod_expires.dsp +++ b/modules/metadata/mod_expires.dsp @@ -52,8 +52,14 @@ 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_expires.so" /base:@..\..\os\win32\BaseAddr.ref,mod_expires.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_expires.so" /base:@..\..\os\win32\BaseAddr.ref,mod_expires.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_expires.so" /base:@..\..\os\win32\BaseAddr.ref,mod_expires.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_expires.so" /base:@..\..\os\win32\BaseAddr.ref,mod_expires.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_expires.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_expires - Win32 Debug" @@ -78,8 +84,14 @@ 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_expires.so" /base:@..\..\os\win32\BaseAddr.ref,mod_expires.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_expires.so" /base:@..\..\os\win32\BaseAddr.ref,mod_expires.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_expires.so" /base:@..\..\os\win32\BaseAddr.ref,mod_expires.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_expires.so" /base:@..\..\os\win32\BaseAddr.ref,mod_expires.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_expires.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 diff --git a/modules/metadata/mod_headers.c b/modules/metadata/mod_headers.c index 34174a18..e139b5db 100644 --- a/modules/metadata/mod_headers.c +++ b/modules/metadata/mod_headers.c @@ -305,11 +305,13 @@ static char *parse_format_tag(apr_pool_t *p, format_tag *tag, const char **sa) } s++; /* skip the % */ - /* Pass through %% as % */ - if (*s == '%') { + /* Pass through %% or % at end of string as % */ + if ((*s == '%') || (*s == '\0')) { tag->func = constant_item; tag->arg = "%"; - *sa = ++s; + if (*s) + s++; + *sa = s; return NULL; } diff --git a/modules/metadata/mod_headers.dsp b/modules/metadata/mod_headers.dsp index 37884c75..c36c4905 100644 --- a/modules/metadata/mod_headers.dsp +++ b/modules/metadata/mod_headers.dsp @@ -52,8 +52,14 @@ 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_headers.so" /base:@..\..\os\win32\BaseAddr.ref,mod_headers.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /debug /out:"Release/mod_headers.so" /base:@..\..\os\win32\BaseAddr.ref,mod_headers.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_headers.so" /base:@..\..\os\win32\BaseAddr.ref,mod_headers.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /debug /out:".\Release\mod_headers.so" /base:@..\..\os\win32\BaseAddr.ref,mod_headers.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_headers.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_headers - Win32 Debug" @@ -78,8 +84,14 @@ 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_headers.so" /base:@..\..\os\win32\BaseAddr.ref,mod_headers.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_headers.so" /base:@..\..\os\win32\BaseAddr.ref,mod_headers.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_headers.so" /base:@..\..\os\win32\BaseAddr.ref,mod_headers.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_headers.so" /base:@..\..\os\win32\BaseAddr.ref,mod_headers.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_headers.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 diff --git a/modules/metadata/mod_ident.dsp b/modules/metadata/mod_ident.dsp index 8d34bfb6..89fbd577 100644 --- a/modules/metadata/mod_ident.dsp +++ b/modules/metadata/mod_ident.dsp @@ -52,8 +52,14 @@ 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_ident.so" /base:@..\..\os\win32\BaseAddr.ref,mod_ident.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_ident.so" /base:@..\..\os\win32\BaseAddr.ref,mod_ident.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_ident.so" /base:@..\..\os\win32\BaseAddr.ref,mod_ident.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_ident.so" /base:@..\..\os\win32\BaseAddr.ref,mod_ident.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_ident.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_ident - Win32 Debug" @@ -78,8 +84,14 @@ 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_ident.so" /base:@..\..\os\win32\BaseAddr.ref,mod_ident.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_ident.so" /base:@..\..\os\win32\BaseAddr.ref,mod_ident.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_ident.so" /base:@..\..\os\win32\BaseAddr.ref,mod_ident.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_ident.so" /base:@..\..\os\win32\BaseAddr.ref,mod_ident.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_ident.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 diff --git a/modules/metadata/mod_mime_magic.dsp b/modules/metadata/mod_mime_magic.dsp index 09462fc6..9989b9a6 100644 --- a/modules/metadata/mod_mime_magic.dsp +++ b/modules/metadata/mod_mime_magic.dsp @@ -52,8 +52,14 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib ws2_32.lib /nologo /subsystem:windows /dll /out:"Release/mod_mime_magic.so" /base:@..\..\os\win32\BaseAddr.ref,mod_mime_magic.so -# ADD LINK32 kernel32.lib ws2_32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_mime_magic.so" /base:@..\..\os\win32\BaseAddr.ref,mod_mime_magic.so /opt:ref +# ADD BASE LINK32 kernel32.lib ws2_32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_mime_magic.so" /base:@..\..\os\win32\BaseAddr.ref,mod_mime_magic.so +# ADD LINK32 kernel32.lib ws2_32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_mime_magic.so" /base:@..\..\os\win32\BaseAddr.ref,mod_mime_magic.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_mime_magic.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_mime_magic - Win32 Debug" @@ -78,8 +84,14 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib ws2_32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_mime_magic.so" /base:@..\..\os\win32\BaseAddr.ref,mod_mime_magic.so -# ADD LINK32 kernel32.lib ws2_32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_mime_magic.so" /base:@..\..\os\win32\BaseAddr.ref,mod_mime_magic.so +# ADD BASE LINK32 kernel32.lib ws2_32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_mime_magic.so" /base:@..\..\os\win32\BaseAddr.ref,mod_mime_magic.so +# ADD LINK32 kernel32.lib ws2_32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_mime_magic.so" /base:@..\..\os\win32\BaseAddr.ref,mod_mime_magic.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_mime_magic.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 diff --git a/modules/metadata/mod_setenvif.dsp b/modules/metadata/mod_setenvif.dsp index fa66a727..0581017f 100644 --- a/modules/metadata/mod_setenvif.dsp +++ b/modules/metadata/mod_setenvif.dsp @@ -52,8 +52,14 @@ 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_setenvif.so" /base:@..\..\os\win32\BaseAddr.ref,mod_setenvif.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_setenvif.so" /base:@..\..\os\win32\BaseAddr.ref,mod_setenvif.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_setenvif.so" /base:@..\..\os\win32\BaseAddr.ref,mod_setenvif.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_setenvif.so" /base:@..\..\os\win32\BaseAddr.ref,mod_setenvif.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_setenvif.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_setenvif - Win32 Debug" @@ -78,8 +84,14 @@ 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_setenvif.so" /base:@..\..\os\win32\BaseAddr.ref,mod_setenvif.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_setenvif.so" /base:@..\..\os\win32\BaseAddr.ref,mod_setenvif.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_setenvif.so" /base:@..\..\os\win32\BaseAddr.ref,mod_setenvif.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_setenvif.so" /base:@..\..\os\win32\BaseAddr.ref,mod_setenvif.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_setenvif.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 diff --git a/modules/metadata/mod_unique_id.dsp b/modules/metadata/mod_unique_id.dsp index 4aa14fc9..46480a9c 100644 --- a/modules/metadata/mod_unique_id.dsp +++ b/modules/metadata/mod_unique_id.dsp @@ -52,8 +52,14 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib ws2_32.lib /nologo /subsystem:windows /dll /out:"Release/mod_unique_id.so" /base:@..\..\os\win32\BaseAddr.ref,mod_unique_id.so -# ADD LINK32 kernel32.lib ws2_32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_unique_id.so" /base:@..\..\os\win32\BaseAddr.ref,mod_unique_id.so /opt:ref +# ADD BASE LINK32 kernel32.lib ws2_32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_unique_id.so" /base:@..\..\os\win32\BaseAddr.ref,mod_unique_id.so +# ADD LINK32 kernel32.lib ws2_32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_unique_id.so" /base:@..\..\os\win32\BaseAddr.ref,mod_unique_id.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_unique_id.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_unique_id - Win32 Debug" @@ -78,8 +84,14 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib ws2_32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_unique_id.so" /base:@..\..\os\win32\BaseAddr.ref,mod_unique_id.so -# ADD LINK32 kernel32.lib ws2_32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_unique_id.so" /base:@..\..\os\win32\BaseAddr.ref,mod_unique_id.so +# ADD BASE LINK32 kernel32.lib ws2_32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_unique_id.so" /base:@..\..\os\win32\BaseAddr.ref,mod_unique_id.so +# ADD LINK32 kernel32.lib ws2_32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_unique_id.so" /base:@..\..\os\win32\BaseAddr.ref,mod_unique_id.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_unique_id.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 diff --git a/modules/metadata/mod_usertrack.dsp b/modules/metadata/mod_usertrack.dsp index 67b126e9..5d1fb82d 100644 --- a/modules/metadata/mod_usertrack.dsp +++ b/modules/metadata/mod_usertrack.dsp @@ -52,8 +52,14 @@ 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_usertrack.so" /base:@..\..\os\win32\BaseAddr.ref,mod_usertrack.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_usertrack.so" /base:@..\..\os\win32\BaseAddr.ref,mod_usertrack.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_usertrack.so" /base:@..\..\os\win32\BaseAddr.ref,mod_usertrack.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_usertrack.so" /base:@..\..\os\win32\BaseAddr.ref,mod_usertrack.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_usertrack.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_usertrack - Win32 Debug" @@ -78,8 +84,14 @@ 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_usertrack.so" /base:@..\..\os\win32\BaseAddr.ref,mod_usertrack.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_usertrack.so" /base:@..\..\os\win32\BaseAddr.ref,mod_usertrack.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_usertrack.so" /base:@..\..\os\win32\BaseAddr.ref,mod_usertrack.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_usertrack.so" /base:@..\..\os\win32\BaseAddr.ref,mod_usertrack.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_usertrack.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 diff --git a/modules/metadata/mod_version.dsp b/modules/metadata/mod_version.dsp index e1ffe13d..907ea736 100644 --- a/modules/metadata/mod_version.dsp +++ b/modules/metadata/mod_version.dsp @@ -52,8 +52,14 @@ 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_version.so" /base:@..\..\os\win32\BaseAddr.ref,mod_version.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_version.so" /base:@..\..\os\win32\BaseAddr.ref,mod_version.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_version.so" /base:@..\..\os\win32\BaseAddr.ref,mod_version.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_version.so" /base:@..\..\os\win32\BaseAddr.ref,mod_version.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_version.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_version - Win32 Debug" @@ -78,8 +84,14 @@ 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_version.so" /base:@..\..\os\win32\BaseAddr.ref,mod_version.so -# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_version.so" /base:@..\..\os\win32\BaseAddr.ref,mod_version.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_version.so" /base:@..\..\os\win32\BaseAddr.ref,mod_version.so +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_version.so" /base:@..\..\os\win32\BaseAddr.ref,mod_version.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_version.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 diff --git a/modules/proxy/NWGNUmakefile b/modules/proxy/NWGNUmakefile index 841673e4..212a5be7 100644 --- a/modules/proxy/NWGNUmakefile +++ b/modules/proxy/NWGNUmakefile @@ -59,7 +59,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -73,7 +73,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -95,7 +95,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = +NLM_NAME = # # This is used by the link '-desc ' directive. @@ -113,7 +113,7 @@ NLM_THREAD_NAME = # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -139,14 +139,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = +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 = +XDCDATA = # # If there is an NLM target, put it here @@ -213,13 +213,13 @@ FILES_nlm_Ximports = \ # 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) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -234,7 +234,7 @@ nlms :: libs $(TARGET_nlm) # correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) # install :: nlms FORCE - copy $(OBJDIR)\*.nlm $(INSTALL)\Apache2\modules\*.* + copy $(OBJDIR)\*.nlm $(INSTALL)\$(BASEDIR)\modules\*.* # # Any specialized rules here @@ -246,4 +246,5 @@ install :: nlms FORCE # include $(AP_WORK)\build\NWGNUtail.inc - + + diff --git a/modules/proxy/NWGNUproxy b/modules/proxy/NWGNUproxy index ac36e50b..eede5a5c 100644 --- a/modules/proxy/NWGNUproxy +++ b/modules/proxy/NWGNUproxy @@ -31,7 +31,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -61,7 +60,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -75,7 +74,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -97,7 +96,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = proxy +NLM_NAME = proxy # # This is used by the link '-desc ' directive. @@ -115,7 +114,7 @@ NLM_THREAD_NAME = Proxy Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -141,14 +140,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -178,7 +177,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -217,7 +216,7 @@ FILES_nlm_Ximports = \ # Don't link with Winsock if standard sockets are being used ifndef USE_STDSOCKETS FILES_nlm_Ximports += @ws2nlm.imp \ - $(EOLIST) + $(EOLIST) endif # @@ -235,13 +234,13 @@ FILES_nlm_exports = \ ap_proxy_ssl_val \ proxy_run_fixups \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -270,3 +269,4 @@ vpath %.c ../arch/netware include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/proxy/NWGNUproxyajp b/modules/proxy/NWGNUproxyajp index 67508914..77942ffc 100644 --- a/modules/proxy/NWGNUproxyajp +++ b/modules/proxy/NWGNUproxyajp @@ -29,7 +29,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -relax_pointers \ $(EOLIST) # @@ -95,7 +94,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = proxyajp +NLM_NAME = proxyajp # # This is used by the link '-desc ' directive. @@ -228,7 +227,7 @@ FILES_nlm_Ximports = \ # Don't link with Winsock if standard sockets are being used ifndef USE_STDSOCKETS FILES_nlm_Ximports += @ws2nlm.imp \ - $(EOLIST) + $(EOLIST) endif # @@ -272,3 +271,4 @@ vpath %.c ../arch/netware include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/proxy/NWGNUproxybalancer b/modules/proxy/NWGNUproxybalancer index 0f7635fa..c50c48f6 100644 --- a/modules/proxy/NWGNUproxybalancer +++ b/modules/proxy/NWGNUproxybalancer @@ -29,7 +29,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -59,7 +58,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -73,7 +72,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -95,7 +94,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = proxybalancer +NLM_NAME = proxybalancer # # This is used by the link '-desc ' directive. @@ -113,7 +112,7 @@ NLM_THREAD_NAME = Prxy Blncr Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -139,14 +138,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -176,7 +175,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -225,7 +224,7 @@ FILES_nlm_Ximports = \ # Don't link with Winsock if standard sockets are being used ifndef USE_STDSOCKETS FILES_nlm_Ximports += @ws2nlm.imp \ - $(EOLIST) + $(EOLIST) endif # @@ -234,13 +233,13 @@ endif FILES_nlm_exports = \ proxy_balancer_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -269,3 +268,4 @@ vpath %.c ../arch/netware include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/proxy/NWGNUproxycon b/modules/proxy/NWGNUproxycon index 1e044b68..6650197b 100644 --- a/modules/proxy/NWGNUproxycon +++ b/modules/proxy/NWGNUproxycon @@ -29,7 +29,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -59,7 +58,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -73,7 +72,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -95,7 +94,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = proxycon +NLM_NAME = proxycon # # This is used by the link '-desc ' directive. @@ -113,7 +112,7 @@ NLM_THREAD_NAME = Proxy Conn Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -139,14 +138,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -221,13 +220,13 @@ FILES_nlm_Ximports = \ FILES_nlm_exports = \ proxy_connect_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -254,3 +253,4 @@ install :: nlms FORCE include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/proxy/NWGNUproxyftp b/modules/proxy/NWGNUproxyftp index c8a1bd84..89fef5ac 100644 --- a/modules/proxy/NWGNUproxyftp +++ b/modules/proxy/NWGNUproxyftp @@ -29,7 +29,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -59,7 +58,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -73,7 +72,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -95,7 +94,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = proxyftp +NLM_NAME = proxyftp # # This is used by the link '-desc ' directive. @@ -113,7 +112,7 @@ NLM_THREAD_NAME = Proxy FTP Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -139,14 +138,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -176,7 +175,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -221,7 +220,7 @@ FILES_nlm_Ximports = \ # Don't link with Winsock if standard sockets are being used ifndef USE_STDSOCKETS FILES_nlm_Ximports += @ws2nlm.imp \ - $(EOLIST) + $(EOLIST) endif # @@ -230,13 +229,13 @@ endif FILES_nlm_exports = \ proxy_ftp_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -265,3 +264,4 @@ vpath %.c ../arch/netware include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/proxy/NWGNUproxyhtp b/modules/proxy/NWGNUproxyhtp index bf4f8701..5f5c2ada 100644 --- a/modules/proxy/NWGNUproxyhtp +++ b/modules/proxy/NWGNUproxyhtp @@ -29,7 +29,6 @@ XINCDIRS += \ # These flags will come after CFLAGS # XCFLAGS += \ - -prefix pre_nw.h \ $(EOLIST) # @@ -59,7 +58,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "noopt" @@ -73,7 +72,7 @@ XDEFINES += \ $(EOLIST) XLFLAGS += \ - $(EOLIST) + $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -95,7 +94,7 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = proxyhtp +NLM_NAME = proxyhtp # # This is used by the link '-desc ' directive. @@ -113,7 +112,7 @@ NLM_THREAD_NAME = Proxy HTTP Module # If this is specified, it will override VERSION value in # $(AP_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -139,14 +138,14 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # 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 = +XDCDATA = # # If there is an NLM target, put it here @@ -176,7 +175,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + libcpre.o \ $(EOLIST) # @@ -222,7 +221,7 @@ FILES_nlm_Ximports = \ # Don't link with Winsock if standard sockets are being used ifndef USE_STDSOCKETS FILES_nlm_Ximports += @ws2nlm.imp \ - $(EOLIST) + $(EOLIST) endif # @@ -231,13 +230,13 @@ endif FILES_nlm_exports = \ proxy_http_module \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # FILES_lib_objs = \ - $(EOLIST) + $(EOLIST) # # implement targets and dependancies (leave this section alone) @@ -266,3 +265,4 @@ vpath %.c ../arch/netware include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/proxy/ajp.h b/modules/proxy/ajp.h index 171fb921..3451a848 100644 --- a/modules/proxy/ajp.h +++ b/modules/proxy/ajp.h @@ -131,6 +131,8 @@ struct ajp_msg apr_size_t len; /** The current read position */ apr_size_t pos; + /** The size of the buffer */ + apr_size_t max_size; /** Flag indicating the origing of the message */ int server_side; }; @@ -141,8 +143,10 @@ struct ajp_msg #define AJP13_WS_HEADER 0x1234 #define AJP_HEADER_LEN 4 #define AJP_HEADER_SZ_LEN 2 -#define AJP_MSG_BUFFER_SZ (8*1024) -#define AJP13_MAX_SEND_BODY_SZ (AJP_MSG_BUFFER_SZ - 6) +#define AJP_HEADER_SZ 6 +#define AJP_MSG_BUFFER_SZ 8192 +#define AJP_MAX_BUFFER_SZ 16384 +#define AJP13_MAX_SEND_BODY_SZ (AJP_MAX_BUFFER_SZ - AJP_HEADER_SZ) /** Send a request from web server to container*/ #define CMD_AJP13_FORWARD_REQUEST (unsigned char)2 @@ -335,10 +339,11 @@ apr_status_t ajp_msg_get_bytes(ajp_msg_t *msg, apr_byte_t **rvalue, * Create an AJP Message from pool * * @param pool memory pool to allocate AJP message from + * @param size size of the buffer to create * @param rmsg Pointer to newly created AJP message * @return APR_SUCCESS or error */ -apr_status_t ajp_msg_create(apr_pool_t *pool, ajp_msg_t **rmsg); +apr_status_t ajp_msg_create(apr_pool_t *pool, apr_size_t size, ajp_msg_t **rmsg); /** * Recopy an AJP Message to another @@ -405,21 +410,25 @@ apr_status_t ajp_ilink_receive(apr_socket_t *sock, ajp_msg_t *msg); * Build the ajp header message and send it * @param sock backend socket * @param r current request + * @param buffsize max size of the AJP packet. * @uri uri requested uri * @return APR_SUCCESS or error */ apr_status_t ajp_send_header(apr_socket_t *sock, request_rec *r, + apr_size_t buffsize, apr_uri_t *uri); /** * Read the ajp message and return the type of the message. * @param sock backend socket * @param r current request + * @param buffsize size of the buffer. * @param msg returned AJP message * @return APR_SUCCESS or error */ apr_status_t ajp_read_header(apr_socket_t *sock, request_rec *r, + apr_size_t buffsize, ajp_msg_t **msg); /** diff --git a/modules/proxy/ajp_header.c b/modules/proxy/ajp_header.c index 5d082531..07ffba97 100644 --- a/modules/proxy/ajp_header.c +++ b/modules/proxy/ajp_header.c @@ -51,7 +51,7 @@ static int sc_for_req_header(const char *header_name) const char *p = header_name; int i = 0; - /* ACCEPT-LANGUAGE is the longest headeer + /* ACCEPT-LANGUAGE is the longest header * that is of interest. */ if (len < 4 || len > 15) @@ -69,11 +69,11 @@ static int sc_for_req_header(const char *header_name) return SC_ACCEPT; else if (header[6] == '-') { p += 6; - if (memcmp(p, "CHARSET", 7) == 0) + if (strcmp(p, "CHARSET") == 0) return SC_ACCEPT_CHARSET; - else if (memcmp(p, "ENCODING", 8) == 0) + else if (strcmp(p, "ENCODING") == 0) return SC_ACCEPT_ENCODING; - else if (memcmp(p, "LANGUAGE", 8) == 0) + else if (strcmp(p, "LANGUAGE") == 0) return SC_ACCEPT_LANGUAGE; else return UNKNOWN_METHOD; @@ -81,45 +81,45 @@ static int sc_for_req_header(const char *header_name) else return UNKNOWN_METHOD; } - else if (memcmp(p, "UTHORIZATION", 12) == 0) + else if (strcmp(p, "UTHORIZATION") == 0) return SC_AUTHORIZATION; else return UNKNOWN_METHOD; break; case 'C': - if(memcmp(p, "OOKIE2", 6) == 0) + if(strcmp(p, "OOKIE2") == 0) return SC_COOKIE2; - else if (memcmp(p, "OOKIE", 5) == 0) + else if (strcmp(p, "OOKIE") == 0) return SC_COOKIE; - else if(memcmp(p, "ONNECTION", 9) == 0) + else if(strcmp(p, "ONNECTION") == 0) return SC_CONNECTION; - else if(memcmp(p, "ONTENT-TYPE", 11) == 0) + else if(strcmp(p, "ONTENT-TYPE") == 0) return SC_CONTENT_TYPE; - else if(memcmp(p, "ONTENT-LENGTH", 13) == 0) + else if(strcmp(p, "ONTENT-LENGTH") == 0) return SC_CONTENT_LENGTH; else return UNKNOWN_METHOD; break; case 'H': - if(memcmp(p, "OST", 3) == 0) + if(strcmp(p, "OST") == 0) return SC_HOST; else return UNKNOWN_METHOD; break; case 'P': - if(memcmp(p, "RAGMA", 5) == 0) + if(strcmp(p, "RAGMA") == 0) return SC_PRAGMA; else return UNKNOWN_METHOD; break; case 'R': - if(memcmp(p, "EFERER", 6) == 0) + if(strcmp(p, "EFERER") == 0) return SC_REFERER; else return UNKNOWN_METHOD; break; case 'U': - if(memcmp(p, "SER-AGENT", 9) == 0) + if(strcmp(p, "SER-AGENT") == 0) return SC_USER_AGENT; else return UNKNOWN_METHOD; @@ -473,10 +473,11 @@ static apr_status_t ajp_unmarshal_response(ajp_msg_t *msg, rc = ajp_msg_get_string(msg, &ptr); if (rc == APR_SUCCESS) { - r->status_line = apr_psprintf(r->pool, "%d %s", status, ptr); -#if defined(AS400) || defined(_OSD_POSIX) - ap_xlate_proto_from_ascii(r->status_line, strlen(r->status_line)); +#if defined(AS400) || defined(_OSD_POSIX) /* EBCDIC platforms */ + ptr = apr_pstrdup(r->pool, ptr); + ap_xlate_proto_from_ascii(ptr, strlen(ptr)); #endif + r->status_line = apr_psprintf(r->pool, "%d %s", status, ptr); } else { r->status_line = NULL; } @@ -561,7 +562,7 @@ static apr_status_t ajp_unmarshal_response(ajp_msg_t *msg, apr_table_add(r->headers_out, stringname, value); /* Content-type needs an additional handling */ - if (memcmp(stringname, "Content-Type", 12) == 0) { + if (strcasecmp(stringname, "Content-Type") == 0) { /* add corresponding filter */ ap_set_content_type(r, apr_pstrdup(r->pool, value)); ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, @@ -577,12 +578,13 @@ static apr_status_t ajp_unmarshal_response(ajp_msg_t *msg, */ apr_status_t ajp_send_header(apr_socket_t *sock, request_rec *r, + apr_size_t buffsize, apr_uri_t *uri) { ajp_msg_t *msg; apr_status_t rc; - rc = ajp_msg_create(r->pool, &msg); + rc = ajp_msg_create(r->pool, buffsize, &msg); if (rc != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server, "ajp_send_header: ajp_msg_create failed"); @@ -611,6 +613,7 @@ apr_status_t ajp_send_header(apr_socket_t *sock, */ apr_status_t ajp_read_header(apr_socket_t *sock, request_rec *r, + apr_size_t buffsize, ajp_msg_t **msg) { apr_byte_t result; @@ -625,7 +628,7 @@ apr_status_t ajp_read_header(apr_socket_t *sock, } } else { - rc = ajp_msg_create(r->pool, msg); + rc = ajp_msg_create(r->pool, buffsize, msg); if (rc != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server, "ajp_read_header: ajp_msg_create failed"); @@ -728,11 +731,11 @@ apr_status_t ajp_alloc_data_msg(apr_pool_t *pool, char **ptr, apr_size_t *len, { apr_status_t rc; - if ((rc = ajp_msg_create(pool, msg)) != APR_SUCCESS) + if ((rc = ajp_msg_create(pool, *len, msg)) != APR_SUCCESS) return rc; ajp_msg_reset(*msg); *ptr = (char *)&((*msg)->buf[6]); - *len = AJP_MSG_BUFFER_SZ-6; + *len = *len - 6; return APR_SUCCESS; } diff --git a/modules/proxy/ajp_msg.c b/modules/proxy/ajp_msg.c index 600fd39e..eef2a538 100644 --- a/modules/proxy/ajp_msg.c +++ b/modules/proxy/ajp_msg.c @@ -43,8 +43,8 @@ char * ajp_msg_dump(apr_pool_t *pool, ajp_msg_t *msg, char *err) rv = apr_palloc(pool, bl); apr_snprintf(rv, bl, "ajp_msg_dump(): %s pos=%" APR_SIZE_T_FMT - " len=%" APR_SIZE_T_FMT " max=%d\n", - err, msg->pos, msg->len, AJP_MSG_BUFFER_SZ); + " len=%" APR_SIZE_T_FMT " max=%" APR_SIZE_T_FMT "\n", + err, msg->pos, msg->len, msg->max_size); bl -= strlen(rv); p = rv + strlen(rv); for (i = 0; i < len; i += 16) { @@ -109,11 +109,11 @@ apr_status_t ajp_msg_check_header(ajp_msg_t *msg, apr_size_t *len) msglen = ((head[2] & 0xff) << 8); msglen += (head[3] & 0xFF); - if (msglen > AJP_MSG_BUFFER_SZ) { + if (msglen > msg->max_size) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL, "ajp_check_msg_header() incoming message is " - "too big %" APR_SIZE_T_FMT ", max is %d", - msglen, AJP_MSG_BUFFER_SZ); + "too big %" APR_SIZE_T_FMT ", max is %" APR_SIZE_T_FMT, + msglen, msg->max_size); return AJP_ETOBIG; } @@ -147,10 +147,13 @@ apr_status_t ajp_msg_reset(ajp_msg_t *msg) apr_status_t ajp_msg_reuse(ajp_msg_t *msg) { apr_byte_t *buf; + apr_size_t max_size; buf = msg->buf; + max_size = msg->max_size; memset(msg, 0, sizeof(ajp_msg_t)); msg->buf = buf; + msg->max_size = max_size; msg->header_len = AJP_HEADER_LEN; ajp_msg_reset(msg); return APR_SUCCESS; @@ -201,7 +204,7 @@ apr_status_t ajp_msg_append_uint32(ajp_msg_t *msg, apr_uint32_t value) { apr_size_t len = msg->len; - if ((len + 4) > AJP_MSG_BUFFER_SZ) { + if ((len + 4) > msg->max_size) { return ajp_log_overflow(msg, "ajp_msg_append_uint32"); } @@ -226,7 +229,7 @@ apr_status_t ajp_msg_append_uint16(ajp_msg_t *msg, apr_uint16_t value) { apr_size_t len = msg->len; - if ((len + 2) > AJP_MSG_BUFFER_SZ) { + if ((len + 2) > msg->max_size) { return ajp_log_overflow(msg, "ajp_msg_append_uint16"); } @@ -249,7 +252,7 @@ apr_status_t ajp_msg_append_uint8(ajp_msg_t *msg, apr_byte_t value) { apr_size_t len = msg->len; - if ((len + 1) > AJP_MSG_BUFFER_SZ) { + if ((len + 1) > msg->max_size) { return ajp_log_overflow(msg, "ajp_msg_append_uint8"); } @@ -278,7 +281,7 @@ apr_status_t ajp_msg_append_string_ex(ajp_msg_t *msg, const char *value, } len = strlen(value); - if ((msg->len + len + 2) > AJP_MSG_BUFFER_SZ) { + if ((msg->len + len + 2) > msg->max_size) { return ajp_log_overflow(msg, "ajp_msg_append_cvt_string"); } @@ -311,7 +314,7 @@ apr_status_t ajp_msg_append_bytes(ajp_msg_t *msg, const apr_byte_t *value, return APR_SUCCESS; /* Shouldn't we indicate an error ? */ } - if ((msg->len + valuelen) > AJP_MSG_BUFFER_SZ) { + if ((msg->len + valuelen) > msg->max_size) { return ajp_log_overflow(msg, "ajp_msg_append_bytes"); } @@ -445,7 +448,7 @@ apr_status_t ajp_msg_get_string(ajp_msg_t *msg, const char **rvalue) status = ajp_msg_get_uint16(msg, &size); start = msg->pos; - if ((status != APR_SUCCESS) || (size + start > AJP_MSG_BUFFER_SZ)) { + if ((status != APR_SUCCESS) || (size + start > msg->max_size)) { return ajp_log_overflow(msg, "ajp_msg_get_string"); } @@ -476,7 +479,7 @@ apr_status_t ajp_msg_get_bytes(ajp_msg_t *msg, apr_byte_t **rvalue, /* save the current position */ start = msg->pos; - if ((status != APR_SUCCESS) || (size + start > AJP_MSG_BUFFER_SZ)) { + if ((status != APR_SUCCESS) || (size + start > msg->max_size)) { return ajp_log_overflow(msg, "ajp_msg_get_bytes"); } msg->pos += (apr_size_t)size; /* only bytes, no trailer */ @@ -492,10 +495,11 @@ apr_status_t ajp_msg_get_bytes(ajp_msg_t *msg, apr_byte_t **rvalue, * Create an AJP Message from pool * * @param pool memory pool to allocate AJP message from + * @param size size of the buffer to create * @param rmsg Pointer to newly created AJP message * @return APR_SUCCESS or error */ -apr_status_t ajp_msg_create(apr_pool_t *pool, ajp_msg_t **rmsg) +apr_status_t ajp_msg_create(apr_pool_t *pool, apr_size_t size, ajp_msg_t **rmsg) { ajp_msg_t *msg = (ajp_msg_t *)apr_pcalloc(pool, sizeof(ajp_msg_t)); @@ -507,7 +511,7 @@ apr_status_t ajp_msg_create(apr_pool_t *pool, ajp_msg_t **rmsg) msg->server_side = 0; - msg->buf = (apr_byte_t *)apr_palloc(pool, AJP_MSG_BUFFER_SZ); + msg->buf = (apr_byte_t *)apr_palloc(pool, size); /* XXX: This should never happen * In case if the OS cannont allocate 8K of data @@ -523,6 +527,7 @@ apr_status_t ajp_msg_create(apr_pool_t *pool, ajp_msg_t **rmsg) msg->len = 0; msg->header_len = AJP_HEADER_LEN; + msg->max_size = size; *rmsg = msg; return APR_SUCCESS; @@ -543,11 +548,11 @@ apr_status_t ajp_msg_copy(ajp_msg_t *smsg, ajp_msg_t *dmsg) return AJP_EINVAL; } - if (smsg->len > AJP_MSG_BUFFER_SZ) { + if (smsg->len > smsg->max_size) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL, "ajp_msg_copy(): destination buffer too " - "small %" APR_SIZE_T_FMT ", max size is %d", - smsg->len, AJP_MSG_BUFFER_SZ); + "small %" APR_SIZE_T_FMT ", max size is %" APR_SIZE_T_FMT, + smsg->len, smsg->max_size); return AJP_ETOSMALL; } diff --git a/modules/proxy/ajp_utils.c b/modules/proxy/ajp_utils.c index 17e25bfb..5a0e8772 100644 --- a/modules/proxy/ajp_utils.c +++ b/modules/proxy/ajp_utils.c @@ -31,7 +31,7 @@ apr_status_t ajp_handle_cping_cpong(apr_socket_t *sock, ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "Into ajp_handle_cping_cpong"); - rc = ajp_msg_create(r->pool, &msg); + rc = ajp_msg_create(r->pool, AJP_HEADER_SZ_LEN+1, &msg); if (rc != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server, "ajp_handle_cping_cpong: ajp_msg_create failed"); diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c index 9e78853d..18b554a7 100644 --- a/modules/proxy/mod_proxy.c +++ b/modules/proxy/mod_proxy.c @@ -219,6 +219,12 @@ static const char *set_worker_param(apr_pool_t *p, else worker->status &= ~PROXY_WORKER_HOT_STANDBY; } + else if (*v == 'I' || *v == 'i') { + if (mode) + worker->status |= PROXY_WORKER_IGNORE_ERRORS; + else + worker->status &= ~PROXY_WORKER_IGNORE_ERRORS; + } else { return "Unknown status parameter option"; } @@ -432,6 +438,8 @@ static int proxy_trans(request_rec *r) (proxy_server_conf *) ap_get_module_config(sconf, &proxy_module); int i, len; struct proxy_alias *ent = (struct proxy_alias *) conf->aliases->elts; + ap_regmatch_t regm[AP_MAX_REG_MATCH]; + char *found = NULL; if (r->proxyreq) { /* someone has already set up the proxy, it was possibly ourselves @@ -446,19 +454,53 @@ static int proxy_trans(request_rec *r) */ for (i = 0; i < conf->aliases->nelts; i++) { - len = alias_match(r->uri, ent[i].fake); + if (ent[i].regex) { + if (!ap_regexec(ent[i].regex, r->uri, AP_MAX_REG_MATCH, regm, 0)) { + if ((ent[i].real[0] == '!') && (ent[i].real[1] == '\0')) { + return DECLINED; + } + found = ap_pregsub(r->pool, ent[i].real, r->uri, AP_MAX_REG_MATCH, + regm); + /* Note: The strcmp() below catches cases where there + * was no regex substitution. This is so cases like: + * + * ProxyPassMatch \.gif balancer://foo + * + * will work "as expected". The upshot is that the 2 + * directives below act the exact same way (ie: $1 is implied): + * + * ProxyPassMatch ^(/.*\.gif)$ balancer://foo + * ProxyPassMatch ^(/.*\.gif)$ balancer://foo$1 + * + * which may be confusing. + */ + if (found && strcmp(found, ent[i].real)) { + found = apr_pstrcat(r->pool, "proxy:", found, NULL); + } + else { + found = apr_pstrcat(r->pool, "proxy:", ent[i].real, r->uri, + NULL); + } + } + } + else { + len = alias_match(r->uri, ent[i].fake); - if (len > 0) { - if ((ent[i].real[0] == '!') && (ent[i].real[1] == 0)) { - return DECLINED; - } + if (len > 0) { + if ((ent[i].real[0] == '!') && (ent[i].real[1] == '\0')) { + return DECLINED; + } - r->filename = apr_pstrcat(r->pool, "proxy:", ent[i].real, - r->uri + len, NULL); - r->handler = "proxy-server"; - r->proxyreq = PROXYREQ_REVERSE; - return OK; - } + found = apr_pstrcat(r->pool, "proxy:", ent[i].real, + r->uri + len, NULL); + } + } + if (found) { + r->filename = found; + r->handler = "proxy-server"; + r->proxyreq = PROXYREQ_REVERSE; + return OK; + } } return DECLINED; } @@ -894,15 +936,25 @@ static void * merge_proxy_config(apr_pool_t *p, void *basev, void *overridesv) ps->domain = (overrides->domain == NULL) ? base->domain : overrides->domain; ps->viaopt = (overrides->viaopt_set == 0) ? base->viaopt : overrides->viaopt; + ps->viaopt_set = overrides->viaopt_set || base->viaopt_set; ps->req = (overrides->req_set == 0) ? base->req : overrides->req; + ps->req_set = overrides->req_set || base->req_set; ps->recv_buffer_size = (overrides->recv_buffer_size_set == 0) ? base->recv_buffer_size : overrides->recv_buffer_size; + ps->recv_buffer_size_set = overrides->recv_buffer_size_set || base->recv_buffer_size_set; ps->io_buffer_size = (overrides->io_buffer_size_set == 0) ? base->io_buffer_size : overrides->io_buffer_size; + ps->io_buffer_size_set = overrides->io_buffer_size_set || base->io_buffer_size_set; ps->maxfwd = (overrides->maxfwd_set == 0) ? base->maxfwd : overrides->maxfwd; + ps->maxfwd_set = overrides->maxfwd_set || base->maxfwd_set; ps->error_override = (overrides->error_override_set == 0) ? base->error_override : overrides->error_override; + ps->error_override_set = overrides->error_override_set || base->error_override_set; ps->preserve_host = (overrides->preserve_host_set == 0) ? base->preserve_host : overrides->preserve_host; + ps->preserve_host_set = overrides->preserve_host_set || base->preserve_host_set; ps->timeout= (overrides->timeout_set == 0) ? base->timeout : overrides->timeout; + ps->timeout_set = overrides->timeout_set || base->timeout_set; ps->badopt = (overrides->badopt_set == 0) ? base->badopt : overrides->badopt; + ps->badopt_set = overrides->badopt_set || base->badopt_set; ps->proxy_status = (overrides->proxy_status_set == 0) ? base->proxy_status : overrides->proxy_status; + ps->proxy_status_set = overrides->proxy_status_set || base->proxy_status_set; ps->pool = p; return ps; } @@ -1021,7 +1073,7 @@ static const char * } static const char * - add_pass(cmd_parms *cmd, void *dummy, const char *arg) + add_pass(cmd_parms *cmd, void *dummy, const char *arg, int is_regex) { server_rec *s = cmd->server; proxy_server_conf *conf = @@ -1034,21 +1086,39 @@ static const char * const apr_array_header_t *arr; const apr_table_entry_t *elts; int i; + int use_regex = is_regex; while (*arg) { word = ap_getword_conf(cmd->pool, &arg); - if (!f) + if (!f) { + if (!strcmp(word, "~")) { + if (is_regex) { + return "ProxyPassMatch invalid syntax ('~' usage)."; + } + use_regex = 1; + continue; + } f = word; + } else if (!r) r = word; else { char *val = strchr(word, '='); if (!val) { - if (cmd->path) - return "Invalid ProxyPass parameter. Parameter must be " - "in the form 'key=value'"; - else - return "ProxyPass can not have a path when defined in a location"; + if (cmd->path) { + if (*r == '/') { + return "ProxyPass|ProxyPassMatch can not have a path when defined in " + "a location."; + } + else { + return "Invalid ProxyPass|ProxyPassMatch parameter. Parameter must " + "be in the form 'key=value'."; + } + } + else { + return "Invalid ProxyPass|ProxyPassMatch parameter. Parameter must be " + "in the form 'key=value'."; + } } else *val++ = '\0'; @@ -1057,11 +1127,20 @@ static const char * }; if (r == NULL) - return "ProxyPass needs a path when not defined in a location"; + return "ProxyPass|ProxyPassMatch needs a path when not defined in a location"; new = apr_array_push(conf->aliases); new->fake = apr_pstrdup(cmd->pool, f); new->real = apr_pstrdup(cmd->pool, r); + if (use_regex) { + new->regex = ap_pregcomp(cmd->pool, f, AP_REG_EXTENDED); + if (new->regex == NULL) + return "Regular expression could not be compiled."; + } + else { + new->regex = NULL; + } + if (r[0] == '!' && r[1] == '\0') return NULL; @@ -1104,6 +1183,19 @@ static const char * } static const char * + add_pass_noregex(cmd_parms *cmd, void *dummy, const char *arg) +{ + return add_pass(cmd, dummy, arg, 0); +} + +static const char * + add_pass_regex(cmd_parms *cmd, void *dummy, const char *arg) +{ + return add_pass(cmd, dummy, arg, 1); +} + + +static const char * add_pass_reverse(cmd_parms *cmd, void *dconf, const char *f, const char *r) { proxy_dir_conf *conf = dconf; @@ -1427,7 +1519,7 @@ static const char* psf->proxy_status = status_full; else { return "ProxyStatus must be one of: " - "off | on | block"; + "off | on | full"; } psf->proxy_status_set = 1; @@ -1519,6 +1611,7 @@ static const char * proxy_balancer *balancer = NULL; proxy_worker *worker = NULL; const char *err; + int in_proxy_section = 0; if (cmd->directive->parent && strncasecmp(cmd->directive->parent->directive, @@ -1530,6 +1623,7 @@ static const char * name = ap_getword_conf(cmd->temp_pool, &pargs); if ((word = ap_strchr(name, '>'))) *word = '\0'; + in_proxy_section = 1; } else { /* Standard set directive with worker/balancer @@ -1541,15 +1635,32 @@ static const char * if (strncasecmp(name, "balancer:", 9) == 0) { balancer = ap_proxy_get_balancer(cmd->pool, conf, name); if (!balancer) { - return apr_pstrcat(cmd->temp_pool, "ProxySet can not find '", - name, "' Balancer.", NULL); + if (in_proxy_section) { + err = ap_proxy_add_balancer(&balancer, + cmd->pool, + conf, name); + if (err) + return apr_pstrcat(cmd->temp_pool, "ProxySet ", + err, NULL); + } + else + return apr_pstrcat(cmd->temp_pool, "ProxySet can not find '", + name, "' Balancer.", NULL); } } else { worker = ap_proxy_get_worker(cmd->temp_pool, conf, name); if (!worker) { - return apr_pstrcat(cmd->temp_pool, "ProxySet can not find '", - name, "' Worker.", NULL); + if (in_proxy_section) { + err = ap_proxy_add_worker(&worker, cmd->pool, + conf, name); + if (err) + return apr_pstrcat(cmd->temp_pool, "ProxySet ", + err, NULL); + } + else + return apr_pstrcat(cmd->temp_pool, "ProxySet can not find '", + name, "' Worker.", NULL); } } @@ -1593,9 +1704,15 @@ static const char *proxysection(cmd_parms *cmd, void *mconfig, const char *arg) ap_conf_vector_t *new_dir_conf = ap_create_per_dir_config(cmd->pool); ap_regex_t *r = NULL; const command_rec *thiscmd = cmd->cmd; + char *word, *val; + proxy_balancer *balancer = NULL; + proxy_worker *worker = NULL; const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT); + proxy_server_conf *sconf = + (proxy_server_conf *) ap_get_module_config(cmd->server->module_config, &proxy_module); + if (err != NULL) { return err; } @@ -1657,8 +1774,61 @@ static const char *proxysection(cmd_parms *cmd, void *mconfig, const char *arg) ap_add_per_proxy_conf(cmd->server, new_dir_conf); if (*arg != '\0') { - return apr_pstrcat(cmd->pool, "Multiple ", thiscmd->name, - "> arguments not (yet) supported.", NULL); + if (thiscmd->cmd_data) + return "Multiple <ProxyMatch> arguments not (yet) supported."; + if (conf->p_is_fnmatch) + return apr_pstrcat(cmd->pool, thiscmd->name, + "> arguments are not supported for wildchar url.", + NULL); + if (!ap_strchr_c(conf->p, ':')) + return apr_pstrcat(cmd->pool, thiscmd->name, + "> arguments are not supported for non url.", + NULL); + if (strncasecmp(conf->p, "balancer:", 9) == 0) { + balancer = ap_proxy_get_balancer(cmd->pool, sconf, conf->p); + if (!balancer) { + err = ap_proxy_add_balancer(&balancer, + cmd->pool, + sconf, conf->p); + if (err) + return apr_pstrcat(cmd->temp_pool, thiscmd->name, + " ", err, NULL); + } + } + else { + worker = ap_proxy_get_worker(cmd->temp_pool, sconf, + conf->p); + if (!worker) { + err = ap_proxy_add_worker(&worker, cmd->pool, + sconf, conf->p); + if (err) + return apr_pstrcat(cmd->temp_pool, thiscmd->name, + " ", err, NULL); + } + } + if (worker == NULL && balancer == NULL) { + return apr_pstrcat(cmd->pool, thiscmd->name, + "> arguments are supported only for workers.", + NULL); + } + while (*arg) { + word = ap_getword_conf(cmd->pool, &arg); + val = strchr(word, '='); + if (!val) { + return "Invalid Proxy parameter. Parameter must be " + "in the form 'key=value'"; + } + else + *val++ = '\0'; + if (worker) + err = set_worker_param(cmd->pool, worker, word, val); + else + err = set_balancer_param(sconf, cmd->pool, balancer, + word, val); + if (err) + return apr_pstrcat(cmd->temp_pool, thiscmd->name, " ", err, " ", + word, "=", val, "; ", conf->p, NULL); + } } cmd->path = old_path; @@ -1681,7 +1851,9 @@ static const command_rec proxy_cmds[] = "a scheme, partial URL or '*' and a proxy server"), AP_INIT_TAKE2("ProxyRemoteMatch", add_proxy_regex, NULL, RSRC_CONF, "a regex pattern and a proxy server"), - AP_INIT_RAW_ARGS("ProxyPass", add_pass, NULL, RSRC_CONF|ACCESS_CONF, + AP_INIT_RAW_ARGS("ProxyPass", add_pass_noregex, NULL, RSRC_CONF|ACCESS_CONF, + "a virtual path and a URL"), + AP_INIT_RAW_ARGS("ProxyPassMatch", add_pass_regex, NULL, RSRC_CONF|ACCESS_CONF, "a virtual path and a URL"), AP_INIT_TAKE12("ProxyPassReverse", add_pass_reverse, NULL, RSRC_CONF|ACCESS_CONF, "a virtual path and a URL for reverse proxy behaviour"), diff --git a/modules/proxy/mod_proxy.dsp b/modules/proxy/mod_proxy.dsp index 30620d13..853406f4 100644 --- a/modules/proxy/mod_proxy.dsp +++ b/modules/proxy/mod_proxy.dsp @@ -52,8 +52,14 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /out:"Release/mod_proxy.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy.so -# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /debug /out:"Release/mod_proxy.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy.so /opt:ref +# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /out:".\Release\mod_proxy.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy.so +# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /debug /out:".\Release\mod_proxy.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_proxy.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_proxy - Win32 Debug" @@ -78,8 +84,14 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_proxy.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy.so -# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_proxy.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy.so +# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_proxy.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy.so +# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_proxy.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_proxy.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 diff --git a/modules/proxy/mod_proxy.h b/modules/proxy/mod_proxy.h index 12659e7d..e7879525 100644 --- a/modules/proxy/mod_proxy.h +++ b/modules/proxy/mod_proxy.h @@ -109,6 +109,7 @@ struct proxy_remote { struct proxy_alias { const char *real; const char *fake; + ap_regex_t *regex; }; struct dirconn_entry { diff --git a/modules/proxy/mod_proxy_ajp.c b/modules/proxy/mod_proxy_ajp.c index d5aa87e7..d02b4364 100644 --- a/modules/proxy/mod_proxy_ajp.c +++ b/modules/proxy/mod_proxy_ajp.c @@ -127,19 +127,31 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r, apr_uint16_t size; const char *tenc; int havebody = 1; - int isok = 1; + int output_failed = 0; + int backend_failed = 0; apr_off_t bb_len; int data_sent = 0; int rv = 0; apr_int32_t conn_poll_fd; apr_pollfd_t *conn_poll; - + proxy_server_conf *psf = + ap_get_module_config(r->server->module_config, &proxy_module); + apr_size_t maxsize = AJP_MSG_BUFFER_SZ; + + if (psf->io_buffer_size_set) + maxsize = psf->io_buffer_size; + if (maxsize > AJP_MAX_BUFFER_SZ) + maxsize = AJP_MAX_BUFFER_SZ; + else if (maxsize < AJP_MSG_BUFFER_SZ) + maxsize = AJP_MSG_BUFFER_SZ; + maxsize = APR_ALIGN(maxsize, 1024); + /* * Send the AJP request to the remote server */ /* send request headers */ - status = ajp_send_header(conn->sock, r, uri); + status = ajp_send_header(conn->sock, r, maxsize, uri); if (status != APR_SUCCESS) { conn->close++; ap_log_error(APLOG_MARK, APLOG_ERR, status, r->server, @@ -153,6 +165,7 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r, } /* allocate an AJP message to store the data of the buckets */ + bufsiz = maxsize; status = ajp_alloc_data_msg(r->pool, &buff, &bufsiz, &msg); if (status != APR_SUCCESS) { /* We had a failure: Close connection to backend */ @@ -172,7 +185,7 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r, } else { status = ap_get_brigade(r->input_filters, input_brigade, AP_MODE_READBYTES, APR_BLOCK_READ, - AJP13_MAX_SEND_BODY_SZ); + maxsize - AJP_HEADER_SZ); if (status != APR_SUCCESS) { /* We had a failure: Close connection to backend */ @@ -225,7 +238,7 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r, /* read the response */ conn->data = NULL; - status = ajp_read_header(conn->sock, r, + status = ajp_read_header(conn->sock, r, maxsize, (ajp_msg_t **)&(conn->data)); if (status != APR_SUCCESS) { /* We had a failure: Close connection to backend */ @@ -251,8 +264,8 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r, conn_poll->desc_type = APR_POLL_SOCKET; conn_poll->desc.s = conn->sock; - bufsiz = AJP13_MAX_SEND_BODY_SZ; - while (isok) { + bufsiz = maxsize; + for (;;) { switch (result) { case CMD_AJP13_GET_BODY_CHUNK: if (havebody) { @@ -266,14 +279,15 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r, status = ap_get_brigade(r->input_filters, input_brigade, AP_MODE_READBYTES, APR_BLOCK_READ, - AJP13_MAX_SEND_BODY_SZ); + maxsize - AJP_HEADER_SZ); if (status != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_DEBUG, status, r->server, "ap_get_brigade failed"); + output_failed = 1; break; } - bufsiz = AJP13_MAX_SEND_BODY_SZ; + bufsiz = maxsize; status = apr_brigade_flatten(input_brigade, buff, &bufsiz); apr_brigade_cleanup(input_brigade); @@ -281,6 +295,7 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r, ap_log_error(APLOG_MARK, APLOG_DEBUG, status, r->server, "apr_brigade_flatten failed"); + output_failed = 1; break; } } @@ -291,6 +306,7 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r, if (status != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_DEBUG, status, r->server, "ajp_send_data_msg failed"); + backend_failed = 1; break; } conn->worker->s->transferred += bufsiz; @@ -301,14 +317,14 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r, */ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "ap_proxy_ajp_request error read after end"); - isok = 0; + backend_failed = 1; } break; case CMD_AJP13_SEND_HEADERS: /* AJP13_SEND_HEADERS: process them */ status = ajp_parse_header(r, conf, conn->data); if (status != APR_SUCCESS) { - isok = 0; + backend_failed = 1; } break; case CMD_AJP13_SEND_BODY_CHUNK: @@ -343,13 +359,13 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r, output_brigade) != APR_SUCCESS) { ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "proxy: error processing body"); - isok = 0; + output_failed = 1; } data_sent = 1; apr_brigade_cleanup(output_brigade); } else { - isok = 0; + backend_failed = 1; } break; case CMD_AJP13_END_RESPONSE: @@ -358,40 +374,42 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r, if (ap_pass_brigade(r->output_filters, output_brigade) != APR_SUCCESS) { ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, - "proxy: error processing body"); - isok = 0; + "proxy: error processing end"); + output_failed = 1; } /* XXX: what about flush here? See mod_jk */ data_sent = 1; break; default: - isok = 0; + backend_failed = 1; break; } /* * If connection has been aborted by client: Stop working. * Nevertheless, we regard our operation so far as a success: - * So do not set isok to 0 and set result to CMD_AJP13_END_RESPONSE + * So reset output_failed to 0 and set result to CMD_AJP13_END_RESPONSE * But: Close this connection to the backend. */ if (r->connection->aborted) { conn->close++; + output_failed = 0; result = CMD_AJP13_END_RESPONSE; - break; } - if (!isok) - break; - - if (result == CMD_AJP13_END_RESPONSE) + /* + * We either have finished successfully or we failed. + * So bail out + */ + if ((result == CMD_AJP13_END_RESPONSE) || backend_failed + || output_failed) break; /* read the response */ - status = ajp_read_header(conn->sock, r, + status = ajp_read_header(conn->sock, r, maxsize, (ajp_msg_t **)&(conn->data)); if (status != APR_SUCCESS) { - isok = 0; + backend_failed = 1; ap_log_error(APLOG_MARK, APLOG_DEBUG, status, r->server, "ajp_read_header failed"); break; @@ -406,11 +424,28 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r, */ apr_brigade_cleanup(output_brigade); - if (status != APR_SUCCESS) { + if (backend_failed || output_failed) { + ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, + "proxy: Processing of request failed backend: %i, " + "output: %i", backend_failed, output_failed); /* We had a failure: Close connection to backend */ conn->close++; + /* Return DONE to avoid error messages being added to the stream */ + if (data_sent) { + rv = DONE; + } + } + else { + ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, + "proxy: got response from %pI (%s)", + conn->worker->cp->addr, + conn->worker->hostname); + rv = OK; + } + + if (backend_failed) { ap_log_error(APLOG_MARK, APLOG_ERR, status, r->server, - "proxy: send body failed to %pI (%s)", + "proxy: dialog to %pI (%s) failed", conn->worker->cp->addr, conn->worker->hostname); /* @@ -419,8 +454,6 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r, */ if (data_sent) { ap_proxy_backend_broke(r, output_brigade); - /* Return DONE to avoid error messages being added to the stream */ - rv = DONE; } else rv = HTTP_SERVICE_UNAVAILABLE; } @@ -442,27 +475,7 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r, apr_brigade_destroy(output_brigade); - if (rv) - return rv; - - /* Nice we have answer to send to the client */ - if (result == CMD_AJP13_END_RESPONSE && isok) { - ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, - "proxy: got response from %pI (%s)", - conn->worker->cp->addr, - conn->worker->hostname); - return OK; - } - - ap_log_error(APLOG_MARK, APLOG_ERR, status, r->server, - "proxy: got bad response (%d) from %pI (%s)", - result, - conn->worker->cp->addr, - conn->worker->hostname); - - /* We had a failure: Close connection to backend */ - conn->close++; - return HTTP_SERVICE_UNAVAILABLE; + return rv; } /* diff --git a/modules/proxy/mod_proxy_ajp.dsp b/modules/proxy/mod_proxy_ajp.dsp index 0a0873b9..74d7b308 100644 --- a/modules/proxy/mod_proxy_ajp.dsp +++ b/modules/proxy/mod_proxy_ajp.dsp @@ -52,8 +52,14 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /out:"Release/mod_proxy_ajp.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_ajp.so -# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /debug /out:"Release/mod_proxy_ajp.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_ajp.so /opt:ref +# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /out:".\Release\mod_proxy_ajp.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_ajp.so +# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /debug /out:".\Release\mod_proxy_ajp.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_ajp.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_proxy_ajp.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_proxy_ajp - Win32 Debug" @@ -78,8 +84,14 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_proxy_ajp.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_ajp.so -# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_proxy_ajp.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_ajp.so +# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_proxy_ajp.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_ajp.so +# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_proxy_ajp.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_ajp.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_proxy_ajp.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 diff --git a/modules/proxy/mod_proxy_balancer.c b/modules/proxy/mod_proxy_balancer.c index 02f5ac3a..e2f22235 100644 --- a/modules/proxy/mod_proxy_balancer.c +++ b/modules/proxy/mod_proxy_balancer.c @@ -234,16 +234,27 @@ static proxy_worker *find_route_worker(proxy_balancer *balancer, static proxy_worker *find_session_route(proxy_balancer *balancer, request_rec *r, char **route, + char **sticky_used, char **url) { proxy_worker *worker = NULL; + char *sticky, *sticky_path, *path; if (!balancer->sticky) return NULL; + sticky = sticky_path = apr_pstrdup(r->pool, balancer->sticky); + if ((path = strchr(sticky, '|'))) { + *path++ = '\0'; + sticky_path = path; + } + /* Try to find the sticky route inside url */ - *route = get_path_param(r->pool, *url, balancer->sticky); - if (!*route) - *route = get_cookie_param(r, balancer->sticky); + *sticky_used = sticky_path; + *route = get_path_param(r->pool, *url, sticky_path); + if (!*route) { + *route = get_cookie_param(r, sticky); + *sticky_used = sticky; + } ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy: BALANCER: Found value %s for " "stickysession %s", *route, balancer->sticky); @@ -369,6 +380,7 @@ static int proxy_balancer_pre_request(proxy_worker **worker, int access_status; proxy_worker *runtime; char *route = NULL; + char *sticky = NULL; apr_status_t rv; *worker = NULL; @@ -383,7 +395,7 @@ static int proxy_balancer_pre_request(proxy_worker **worker, /* Step 2: find the session route */ - runtime = find_session_route(*balancer, r, &route, url); + runtime = find_session_route(*balancer, r, &route, &sticky, url); /* Lock the LoadBalancer * XXX: perhaps we need the process lock here */ @@ -421,15 +433,32 @@ static int proxy_balancer_pre_request(proxy_worker **worker, *worker = runtime; } else if (route && (*balancer)->sticky_force) { - ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server, - "proxy: BALANCER: (%s). All workers are in error state for route (%s)", - (*balancer)->name, route); - if ((rv = PROXY_THREAD_UNLOCK(*balancer)) != APR_SUCCESS) { - ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server, - "proxy: BALANCER: (%s). Unlock failed for pre_request", - (*balancer)->name); + int i, member_of = 0; + proxy_worker *workers; + /* + * We have a route provided that doesn't match the + * balancer name. See if the provider route is the + * member of the same balancer in which case return 503 + */ + workers = (proxy_worker *)(*balancer)->workers->elts; + for (i = 0; i < (*balancer)->workers->nelts; i++) { + if (*(workers->s->route) && strcmp(workers->s->route, route) == 0) { + member_of = 1; + break; + } + workers++; + } + if (member_of) { + ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server, + "proxy: BALANCER: (%s). All workers are in error state for route (%s)", + (*balancer)->name, route); + if ((rv = PROXY_THREAD_UNLOCK(*balancer)) != APR_SUCCESS) { + ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server, + "proxy: BALANCER: (%s). Unlock failed for pre_request", + (*balancer)->name); + } + return HTTP_SERVICE_UNAVAILABLE; } - return HTTP_SERVICE_UNAVAILABLE; } if ((rv = PROXY_THREAD_UNLOCK(*balancer)) != APR_SUCCESS) { @@ -476,12 +505,12 @@ static int proxy_balancer_pre_request(proxy_worker **worker, access_status = rewrite_url(r, *worker, url); /* Add the session route to request notes if present */ if (route) { - apr_table_setn(r->notes, "session-sticky", (*balancer)->sticky); + apr_table_setn(r->notes, "session-sticky", sticky); apr_table_setn(r->notes, "session-route", route); /* Add session info to env. */ apr_table_setn(r->subprocess_env, - "BALANCER_SESSION_STICKY", (*balancer)->sticky); + "BALANCER_SESSION_STICKY", sticky); apr_table_setn(r->subprocess_env, "BALANCER_SESSION_ROUTE", route); } @@ -497,6 +526,8 @@ static int proxy_balancer_post_request(proxy_worker *worker, request_rec *r, proxy_server_conf *conf) { + +#if 0 apr_status_t rv; if ((rv = PROXY_THREAD_LOCK(balancer)) != APR_SUCCESS) { @@ -505,12 +536,7 @@ static int proxy_balancer_post_request(proxy_worker *worker, balancer->name); return HTTP_INTERNAL_SERVER_ERROR; } - /* TODO: calculate the bytes transferred - * This will enable to elect the worker that has - * the lowest load. - * The bytes transferred depends on the protocol - * used, so each protocol handler should keep the - * track on that. + /* TODO: placeholder for post_request actions */ if ((rv = PROXY_THREAD_UNLOCK(balancer)) != APR_SUCCESS) { @@ -521,6 +547,8 @@ static int proxy_balancer_post_request(proxy_worker *worker, ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy_balancer_post_request for (%s)", balancer->name); +#endif + return OK; } diff --git a/modules/proxy/mod_proxy_balancer.dsp b/modules/proxy/mod_proxy_balancer.dsp index 219bf0f4..12168e55 100644 --- a/modules/proxy/mod_proxy_balancer.dsp +++ b/modules/proxy/mod_proxy_balancer.dsp @@ -52,8 +52,14 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /out:"Release/mod_proxy_balancer.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_balancer.so -# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_proxy_balancer.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_balancer.so /opt:ref +# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /out:".\Release\mod_proxy_balancer.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_balancer.so +# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_proxy_balancer.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_balancer.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_proxy_balancer.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_proxy_balancer - Win32 Debug" @@ -78,8 +84,14 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_proxy_balancer.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_balancer.so -# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_proxy_balancer.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_balancer.so +# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_proxy_balancer.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_balancer.so +# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_proxy_balancer.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_balancer.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_proxy_balancer.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 diff --git a/modules/proxy/mod_proxy_connect.c b/modules/proxy/mod_proxy_connect.c index eb9b7de7..8804359c 100644 --- a/modules/proxy/mod_proxy_connect.c +++ b/modules/proxy/mod_proxy_connect.c @@ -113,50 +113,57 @@ static int proxy_connect_handler(request_rec *r, proxy_worker *worker, /* we break the URL into host, port, uri */ if (APR_SUCCESS != apr_uri_parse_hostinfo(p, url, &uri)) { - return ap_proxyerror(r, HTTP_BAD_REQUEST, - apr_pstrcat(p, "URI cannot be parsed: ", url, NULL)); + return ap_proxyerror(r, HTTP_BAD_REQUEST, + apr_pstrcat(p, "URI cannot be parsed: ", url, + NULL)); } ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy: CONNECT: connecting %s to %s:%d", url, uri.hostname, uri.port); /* do a DNS lookup for the destination host */ - err = apr_sockaddr_info_get(&uri_addr, uri.hostname, APR_UNSPEC, uri.port, 0, p); + err = apr_sockaddr_info_get(&uri_addr, uri.hostname, APR_UNSPEC, uri.port, + 0, p); + if (APR_SUCCESS != err) { + return ap_proxyerror(r, HTTP_BAD_GATEWAY, + apr_pstrcat(p, "DNS lookup failure for: ", + uri.hostname, NULL)); + } /* are we connecting directly, or via a proxy? */ if (proxyname) { - connectname = proxyname; - connectport = proxyport; + connectname = proxyname; + connectport = proxyport; err = apr_sockaddr_info_get(&connect_addr, proxyname, APR_UNSPEC, proxyport, 0, p); } else { - connectname = uri.hostname; - connectport = uri.port; - connect_addr = uri_addr; + connectname = uri.hostname; + connectport = uri.port; + connect_addr = uri_addr; } ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy: CONNECT: connecting to remote proxy %s on port %d", connectname, connectport); - + /* check if ProxyBlock directive on this host */ if (OK != ap_proxy_checkproxyblock(r, conf, uri_addr)) { - return ap_proxyerror(r, HTTP_FORBIDDEN, - "Connect to remote machine blocked"); + return ap_proxyerror(r, HTTP_FORBIDDEN, + "Connect to remote machine blocked"); } /* Check if it is an allowed port */ if (conf->allowed_connect_ports->nelts == 0) { /* Default setting if not overridden by AllowCONNECT */ - switch (uri.port) { - case APR_URI_HTTPS_DEFAULT_PORT: - case APR_URI_SNEWS_DEFAULT_PORT: - break; - default: + switch (uri.port) { + case APR_URI_HTTPS_DEFAULT_PORT: + case APR_URI_SNEWS_DEFAULT_PORT: + break; + default: /* XXX can we call ap_proxyerror() here to get a nice log message? */ - return HTTP_FORBIDDEN; - } + return HTTP_FORBIDDEN; + } } else if(!allowed_port(conf, uri.port)) { /* XXX can we call ap_proxyerror() here to get a nice log message? */ - return HTTP_FORBIDDEN; + return HTTP_FORBIDDEN; } /* @@ -169,9 +176,9 @@ static int proxy_connect_handler(request_rec *r, proxy_worker *worker, * until we get a successful connection */ if (APR_SUCCESS != err) { - return ap_proxyerror(r, HTTP_BAD_GATEWAY, apr_pstrcat(p, - "DNS lookup failure for: ", - connectname, NULL)); + return ap_proxyerror(r, HTTP_BAD_GATEWAY, + apr_pstrcat(p, "DNS lookup failure for: ", + connectname, NULL)); } /* @@ -260,9 +267,8 @@ static int proxy_connect_handler(request_rec *r, proxy_worker *worker, /* r->sent_bodyct = 1;*/ - if ((rv = apr_pollset_create(&pollset, 2, r->pool, 0)) != APR_SUCCESS) - { - apr_socket_close(sock); + if ((rv = apr_pollset_create(&pollset, 2, r->pool, 0)) != APR_SUCCESS) { + apr_socket_close(sock); ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "proxy: CONNECT: error apr_pollset_create()"); return HTTP_INTERNAL_SERVER_ERROR; @@ -282,7 +288,7 @@ static int proxy_connect_handler(request_rec *r, proxy_worker *worker, while (1) { /* Infinite loop until error (one side closes the connection) */ if ((rv = apr_pollset_poll(pollset, -1, &pollcnt, &signalled)) != APR_SUCCESS) { - apr_socket_close(sock); + apr_socket_close(sock); ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "proxy: CONNECT: error apr_poll()"); return HTTP_INTERNAL_SERVER_ERROR; } diff --git a/modules/proxy/mod_proxy_connect.dsp b/modules/proxy/mod_proxy_connect.dsp index fc7e4745..24647bfa 100644 --- a/modules/proxy/mod_proxy_connect.dsp +++ b/modules/proxy/mod_proxy_connect.dsp @@ -52,8 +52,14 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /out:"Release/mod_proxy_connect.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_connect.so -# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_proxy_connect.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_connect.so /opt:ref +# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /out:".\Release\mod_proxy_connect.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_connect.so +# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_proxy_connect.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_connect.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_proxy_connect.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_proxy_connect - Win32 Debug" @@ -78,8 +84,14 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_proxy_connect.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_connect.so -# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_proxy_connect.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_connect.so +# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_proxy_connect.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_connect.so +# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_proxy_connect.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_connect.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_proxy_connect.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 diff --git a/modules/proxy/mod_proxy_ftp.c b/modules/proxy/mod_proxy_ftp.c index 03cb0953..eac6eff6 100644 --- a/modules/proxy/mod_proxy_ftp.c +++ b/modules/proxy/mod_proxy_ftp.c @@ -1233,6 +1233,12 @@ static int proxy_ftp_handler(request_rec *r, proxy_worker *worker, } #endif + rv = apr_socket_opt_set(data_sock, APR_TCP_NODELAY, 1); + if (rv != APR_SUCCESS && rv != APR_ENOTIMPL) { + ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, + "apr_socket_opt_set(APR_TCP_NODELAY): Failed to set"); + } + /* make the connection */ apr_socket_addr_get(&data_addr, APR_REMOTE, sock); apr_sockaddr_ip_get(&data_ip, data_addr); @@ -1321,6 +1327,12 @@ static int proxy_ftp_handler(request_rec *r, proxy_worker *worker, } #endif + rv = apr_socket_opt_set(data_sock, APR_TCP_NODELAY, 1); + if (rv != APR_SUCCESS && rv != APR_ENOTIMPL) { + ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, + "apr_socket_opt_set(APR_TCP_NODELAY): Failed to set"); + } + /* make the connection */ apr_sockaddr_info_get(&pasv_addr, apr_psprintf(p, "%d.%d.%d.%d", h3, h2, h1, h0), connect_addr->family, pasvport, 0, p); rv = apr_socket_connect(data_sock, pasv_addr); diff --git a/modules/proxy/mod_proxy_ftp.dsp b/modules/proxy/mod_proxy_ftp.dsp index e4244028..2ad17119 100644 --- a/modules/proxy/mod_proxy_ftp.dsp +++ b/modules/proxy/mod_proxy_ftp.dsp @@ -52,8 +52,14 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /out:"Release/mod_proxy_ftp.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_ftp.so -# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_proxy_ftp.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_ftp.so /opt:ref +# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /out:".\Release\mod_proxy_ftp.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_ftp.so +# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_proxy_ftp.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_ftp.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_proxy_ftp.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_proxy_ftp - Win32 Debug" @@ -78,8 +84,14 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_proxy_ftp.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_ftp.so -# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_proxy_ftp.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_ftp.so +# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_proxy_ftp.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_ftp.so +# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_proxy_ftp.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_ftp.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_proxy_ftp.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 diff --git a/modules/proxy/mod_proxy_http.c b/modules/proxy/mod_proxy_http.c index 39a0c563..534cbb5d 100644 --- a/modules/proxy/mod_proxy_http.c +++ b/modules/proxy/mod_proxy_http.c @@ -333,7 +333,10 @@ static apr_status_t stream_reqbody_cl(apr_pool_t *p, if (old_cl_val) { add_cl(p, bucket_alloc, header_brigade, old_cl_val); - cl_val = atol(old_cl_val); + if (APR_SUCCESS != (status = apr_strtoff(&cl_val, old_cl_val, NULL, + 0))) { + return status; + } } terminate_headers(bucket_alloc, header_brigade); @@ -951,7 +954,8 @@ apr_status_t ap_proxy_http_request(apr_pool_t *p, request_rec *r, else if (old_te_val) { if (force10 || (apr_table_get(r->subprocess_env, "proxy-sendcl") - && !apr_table_get(r->subprocess_env, "proxy-sendchunks"))) { + && !apr_table_get(r->subprocess_env, "proxy-sendchunks") + && !apr_table_get(r->subprocess_env, "proxy-sendchunked"))) { rb_method = RB_SPOOL_CL; } else { @@ -963,7 +967,8 @@ apr_status_t ap_proxy_http_request(apr_pool_t *p, request_rec *r, rb_method = RB_STREAM_CL; } else if (!force10 - && apr_table_get(r->subprocess_env, "proxy-sendchunks") + && (apr_table_get(r->subprocess_env, "proxy-sendchunks") + || apr_table_get(r->subprocess_env, "proxy-sendchunked")) && !apr_table_get(r->subprocess_env, "proxy-sendcl")) { rb_method = RB_STREAM_CHUNKED; } @@ -1188,6 +1193,28 @@ static int addit_dammit(void *v, const char *key, const char *val) } static +apr_status_t ap_proxygetline(apr_bucket_brigade *bb, char *s, int n, request_rec *r, + int fold, int *writen) +{ + char *tmp_s = s; + apr_status_t rv; + apr_size_t len; + + rv = ap_rgetline(&tmp_s, n, &len, r, fold, bb); + apr_brigade_cleanup(bb); + + if (rv == APR_SUCCESS) { + *writen = (int) len; + } else if (rv == APR_ENOSPC) { + *writen = n; + } else { + *writen = -1; + } + + return rv; +} + +static apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r, proxy_conn_rec *backend, conn_rec *origin, @@ -1199,7 +1226,7 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r, char keepchar; request_rec *rp; apr_bucket *e; - apr_bucket_brigade *bb; + apr_bucket_brigade *bb, *tmp_bb; int len, backasswards; int interim_response; /* non-zero whilst interim 1xx responses * are being read. */ @@ -1218,16 +1245,19 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r, * response. */ rp->proxyreq = PROXYREQ_RESPONSE; + tmp_bb = apr_brigade_create(p, c->bucket_alloc); do { + apr_status_t rc; + apr_brigade_cleanup(bb); - len = ap_getline(buffer, sizeof(buffer), rp, 0); + rc = ap_proxygetline(tmp_bb, buffer, sizeof(buffer), rp, 0, &len); if (len == 0) { /* handle one potential stray CRLF */ - len = ap_getline(buffer, sizeof(buffer), rp, 0); + rc = ap_proxygetline(tmp_bb, buffer, sizeof(buffer), rp, 0, &len); } if (len <= 0) { - ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, + ap_log_rerror(APLOG_MARK, APLOG_ERR, rc, r, "proxy: error reading status line from remote " "server %s", backend->hostname); return ap_proxyerror(r, HTTP_BAD_GATEWAY, @@ -1452,7 +1482,7 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r, * if we are overriding the errors, we can't put the content * of the page into the brigade */ - if (!conf->error_override || ap_is_HTTP_SUCCESS(r->status)) { + if (!conf->error_override || !ap_is_HTTP_ERROR(r->status)) { /* read the body, pass it to the output filters */ apr_read_type_e mode = APR_NONBLOCK_READ; int finish = FALSE; @@ -1561,7 +1591,7 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r, if (conf->error_override) { /* the code above this checks for 'OK' which is what the hook expects */ - if (ap_is_HTTP_SUCCESS(r->status)) + if (!ap_is_HTTP_ERROR(r->status)) return OK; else { /* clear r->status for override error, otherwise ErrorDocument @@ -1571,7 +1601,8 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r, int status = r->status; r->status = HTTP_OK; /* Discard body, if one is expected */ - if ((status != HTTP_NO_CONTENT) && /* not 204 */ + if (!r->header_only && /* not HEAD request */ + (status != HTTP_NO_CONTENT) && /* not 204 */ (status != HTTP_NOT_MODIFIED)) { /* not 304 */ ap_discard_request_body(rp); } diff --git a/modules/proxy/mod_proxy_http.dsp b/modules/proxy/mod_proxy_http.dsp index 23538d3c..7d488150 100644 --- a/modules/proxy/mod_proxy_http.dsp +++ b/modules/proxy/mod_proxy_http.dsp @@ -52,8 +52,14 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /out:"Release/mod_proxy_http.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_http.so -# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_proxy_http.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_http.so /opt:ref +# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /out:".\Release\mod_proxy_http.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_http.so +# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_proxy_http.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_http.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_proxy_http.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_proxy_http - Win32 Debug" @@ -78,8 +84,14 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_proxy_http.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_http.so -# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_proxy_http.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_http.so +# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_proxy_http.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_http.so +# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_proxy_http.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_http.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_proxy_http.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 diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index c9c62139..934f9027 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -49,21 +49,27 @@ PROXY_DECLARE(int) ap_proxy_hex2c(const char *x) #if !APR_CHARSET_EBCDIC ch = x[0]; - if (apr_isdigit(ch)) - i = ch - '0'; - else if (apr_isupper(ch)) - i = ch - ('A' - 10); - else - i = ch - ('a' - 10); + if (apr_isdigit(ch)) { + i = ch - '0'; + } + else if (apr_isupper(ch)) { + i = ch - ('A' - 10); + } + else { + i = ch - ('a' - 10); + } i <<= 4; ch = x[1]; - if (apr_isdigit(ch)) - i += ch - '0'; - else if (apr_isupper(ch)) - i += ch - ('A' - 10); - else - i += ch - ('a' - 10); + if (apr_isdigit(ch)) { + i += ch - '0'; + } + else if (apr_isupper(ch)) { + i += ch - ('A' - 10); + } + else { + i += ch - ('a' - 10); + } return i; #else /*APR_CHARSET_EBCDIC*/ /* @@ -98,16 +104,20 @@ PROXY_DECLARE(void) ap_proxy_c2hex(int ch, char *x) x[0] = '%'; i = (ch & 0xF0) >> 4; - if (i >= 10) - x[1] = ('A' - 10) + i; - else - x[1] = '0' + i; + if (i >= 10) { + x[1] = ('A' - 10) + i; + } + else { + x[1] = '0' + i; + } i = ch & 0x0F; - if (i >= 10) - x[2] = ('A' - 10) + i; - else - x[2] = '0' + i; + if (i >= 10) { + x[2] = ('A' - 10) + i; + } + else { + x[2] = '0' + i; + } #else /*APR_CHARSET_EBCDIC*/ static const char ntoa[] = { "0123456789ABCDEF" }; char buf[1]; @@ -134,8 +144,9 @@ PROXY_DECLARE(void) ap_proxy_c2hex(int ch, char *x) * and encodes those which must be encoded, and does not touch * those which must not be touched. */ -PROXY_DECLARE(char *)ap_proxy_canonenc(apr_pool_t *p, const char *x, int len, enum enctype t, - int forcedec, int proxyreq) +PROXY_DECLARE(char *)ap_proxy_canonenc(apr_pool_t *p, const char *x, int len, + enum enctype t, int forcedec, + int proxyreq) { int i, j, ch; char *y; @@ -150,55 +161,65 @@ PROXY_DECLARE(char *)ap_proxy_canonenc(apr_pool_t *p, const char *x, int len, en * it may be form-encoded. (Although RFC 1738 doesn't allow this - * it only permits ; / ? : @ = & as reserved chars.) */ - if (t == enc_path) - allowed = "$-_.+!*'(),;:@&="; - else if (t == enc_search) - allowed = "$-_.!*'(),;:@&="; - else if (t == enc_user) - allowed = "$-_.+!*'(),;@&="; - else if (t == enc_fpath) - allowed = "$-_.+!*'(),?:@&="; - else /* if (t == enc_parm) */ - allowed = "$-_.+!*'(),?/:@&="; - - if (t == enc_path) - reserved = "/"; - else if (t == enc_search) - reserved = "+"; - else - reserved = ""; + if (t == enc_path) { + allowed = "~$-_.+!*'(),;:@&="; + } + else if (t == enc_search) { + allowed = "$-_.!*'(),;:@&="; + } + else if (t == enc_user) { + allowed = "$-_.+!*'(),;@&="; + } + else if (t == enc_fpath) { + allowed = "$-_.+!*'(),?:@&="; + } + else { /* if (t == enc_parm) */ + allowed = "$-_.+!*'(),?/:@&="; + } + + if (t == enc_path) { + reserved = "/"; + } + else if (t == enc_search) { + reserved = "+"; + } + else { + reserved = ""; + } y = apr_palloc(p, 3 * len + 1); for (i = 0, j = 0; i < len; i++, j++) { /* always handle '/' first */ - ch = x[i]; - if (strchr(reserved, ch)) { - y[j] = ch; - continue; - } + ch = x[i]; + if (strchr(reserved, ch)) { + y[j] = ch; + continue; + } /* * decode it if not already done. do not decode reverse proxied URLs * unless specifically forced */ - if ((forcedec || (proxyreq && proxyreq != PROXYREQ_REVERSE)) && ch == '%') { - if (!apr_isxdigit(x[i + 1]) || !apr_isxdigit(x[i + 2])) - return NULL; - ch = ap_proxy_hex2c(&x[i + 1]); - i += 2; - if (ch != 0 && strchr(reserved, ch)) { /* keep it encoded */ - ap_proxy_c2hex(ch, &y[j]); - j += 2; - continue; + if ((forcedec || (proxyreq && proxyreq != PROXYREQ_REVERSE)) && ch == '%') { + if (!apr_isxdigit(x[i + 1]) || !apr_isxdigit(x[i + 2])) { + return NULL; + } + ch = ap_proxy_hex2c(&x[i + 1]); + i += 2; + if (ch != 0 && strchr(reserved, ch)) { /* keep it encoded */ + ap_proxy_c2hex(ch, &y[j]); + j += 2; + continue; + } } - } /* recode it, if necessary */ - if (!apr_isalnum(ch) && !strchr(allowed, ch)) { - ap_proxy_c2hex(ch, &y[j]); - j += 2; - } - else - y[j] = ch; + if (!apr_isalnum(ch) && !strchr(allowed, ch)) { + ap_proxy_c2hex(ch, &y[j]); + j += 2; + } + else { + y[j] = ch; + } } y[j] = '\0'; return y; @@ -223,41 +244,46 @@ PROXY_DECLARE(char *) apr_port_t tmp_port; apr_status_t rv; - if (url[0] != '/' || url[1] != '/') - return "Malformed URL"; + if (url[0] != '/' || url[1] != '/') { + return "Malformed URL"; + } host = url + 2; url = strchr(host, '/'); - if (url == NULL) - url = ""; - else - *(url++) = '\0'; /* skip seperating '/' */ + if (url == NULL) { + url = ""; + } + else { + *(url++) = '\0'; /* skip seperating '/' */ + } /* find _last_ '@' since it might occur in user/password part */ strp = strrchr(host, '@'); if (strp != NULL) { - *strp = '\0'; - user = host; - host = strp + 1; + *strp = '\0'; + user = host; + host = strp + 1; /* find password */ - strp = strchr(user, ':'); - if (strp != NULL) { - *strp = '\0'; - password = ap_proxy_canonenc(p, strp + 1, strlen(strp + 1), enc_user, 1, 0); - if (password == NULL) - return "Bad %-escape in URL (password)"; - } + strp = strchr(user, ':'); + if (strp != NULL) { + *strp = '\0'; + password = ap_proxy_canonenc(p, strp + 1, strlen(strp + 1), enc_user, 1, 0); + if (password == NULL) { + return "Bad %-escape in URL (password)"; + } + } - user = ap_proxy_canonenc(p, user, strlen(user), enc_user, 1, 0); - if (user == NULL) - return "Bad %-escape in URL (username)"; + user = ap_proxy_canonenc(p, user, strlen(user), enc_user, 1, 0); + if (user == NULL) { + return "Bad %-escape in URL (username)"; + } } if (userp != NULL) { - *userp = user; + *userp = user; } if (passwordp != NULL) { - *passwordp = password; + *passwordp = password; } /* @@ -280,70 +306,28 @@ PROXY_DECLARE(char *) return NULL; } -static const char * const lwday[7] = -{"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}; - /* * If the date is a valid RFC 850 date or asctime() date, then it - * is converted to the RFC 1123 format, otherwise it is not modified. - * This routine is not very fast at doing conversions, as it uses - * sscanf and sprintf. However, if the date is already correctly - * formatted, then it exits very quickly. + * is converted to the RFC 1123 format. */ PROXY_DECLARE(const char *) - ap_proxy_date_canon(apr_pool_t *p, const char *x1) + ap_proxy_date_canon(apr_pool_t *p, const char *date) { - char *x = apr_pstrdup(p, x1); - int wk, mday, year, hour, min, sec, mon; - char *q, month[4], zone[4], week[4]; - - q = strchr(x, ','); - /* check for RFC 850 date */ - if (q != NULL && q - x > 3 && q[1] == ' ') { - *q = '\0'; - for (wk = 0; wk < 7; wk++) - if (strcmp(x, lwday[wk]) == 0) - break; - *q = ','; - if (wk == 7) - return x; /* not a valid date */ - if (q[4] != '-' || q[8] != '-' || q[11] != ' ' || q[14] != ':' || - q[17] != ':' || strcmp(&q[20], " GMT") != 0) - return x; - if (sscanf(q + 2, "%u-%3s-%u %u:%u:%u %3s", &mday, month, &year, - &hour, &min, &sec, zone) != 7) - return x; - if (year < 70) - year += 2000; - else - year += 1900; + apr_status_t rv; + char* ndate; + + apr_time_t time = apr_date_parse_http(date); + if (!time) { + return date; } - else { -/* check for acstime() date */ - if (x[3] != ' ' || x[7] != ' ' || x[10] != ' ' || x[13] != ':' || - x[16] != ':' || x[19] != ' ' || x[24] != '\0') - return x; - if (sscanf(x, "%3s %3s %u %u:%u:%u %u", week, month, &mday, &hour, - &min, &sec, &year) != 7) - return x; - for (wk = 0; wk < 7; wk++) - if (strcmp(week, apr_day_snames[wk]) == 0) - break; - if (wk == 7) - return x; - } - -/* check date */ - for (mon = 0; mon < 12; mon++) - if (strcmp(month, apr_month_snames[mon]) == 0) - break; - if (mon == 12) - return x; - - q = apr_palloc(p, 30); - apr_snprintf(q, 30, "%s, %.2d %s %d %.2d:%.2d:%.2d GMT", apr_day_snames[wk], - mday, apr_month_snames[mon], year, hour, min, sec); - return q; + + ndate = apr_palloc(p, APR_RFC822_DATE_LEN); + rv = apr_rfc822_date(ndate, time); + if (rv != APR_SUCCESS) { + return date; + } + + return ndate; } PROXY_DECLARE(request_rec *)ap_proxy_make_fake_req(conn_rec *c, request_rec *r) @@ -389,21 +373,24 @@ PROXY_DECLARE(int) ap_proxy_liststr(const char *list, const char *val) len = strlen(val); while (list != NULL) { - p = ap_strchr_c(list, ','); - if (p != NULL) { - i = p - list; - do - p++; - while (apr_isspace(*p)); - } - else - i = strlen(list); + p = ap_strchr_c(list, ','); + if (p != NULL) { + i = p - list; + do { + p++; + } while (apr_isspace(*p)); + } + else { + i = strlen(list); + } - while (i > 0 && apr_isspace(list[i - 1])) - i--; - if (i == len && strncasecmp(list, val, len) == 0) - return 1; - list = p; + while (i > 0 && apr_isspace(list[i - 1])) { + i--; + } + if (i == len && strncasecmp(list, val, len) == 0) { + return 1; + } + list = p; } return 0; } @@ -423,28 +410,32 @@ PROXY_DECLARE(char *)ap_proxy_removestr(apr_pool_t *pool, const char *list, cons len = strlen(val); while (list != NULL) { - p = ap_strchr_c(list, ','); - if (p != NULL) { - i = p - list; - do - p++; - while (apr_isspace(*p)); - } - else - i = strlen(list); + p = ap_strchr_c(list, ','); + if (p != NULL) { + i = p - list; + do { + p++; + } while (apr_isspace(*p)); + } + else { + i = strlen(list); + } - while (i > 0 && apr_isspace(list[i - 1])) - i--; - if (i == len && strncasecmp(list, val, len) == 0) { - /* do nothing */ - } - else { - if (new) - new = apr_pstrcat(pool, new, ",", apr_pstrndup(pool, list, i), NULL); - else - new = apr_pstrndup(pool, list, i); - } - list = p; + while (i > 0 && apr_isspace(list[i - 1])) { + i--; + } + if (i == len && strncasecmp(list, val, len) == 0) { + /* do nothing */ + } + else { + if (new) { + new = apr_pstrcat(pool, new, ",", apr_pstrndup(pool, list, i), NULL); + } + else { + new = apr_pstrndup(pool, list, i); + } + } + list = p; } return new; } @@ -458,19 +449,24 @@ PROXY_DECLARE(int) ap_proxy_hex2sec(const char *x) unsigned int j; for (i = 0, j = 0; i < 8; i++) { - ch = x[i]; - j <<= 4; - if (apr_isdigit(ch)) - j |= ch - '0'; - else if (apr_isupper(ch)) - j |= ch - ('A' - 10); - else - j |= ch - ('a' - 10); + ch = x[i]; + j <<= 4; + if (apr_isdigit(ch)) { + j |= ch - '0'; + } + else if (apr_isupper(ch)) { + j |= ch - ('A' - 10); + } + else { + j |= ch - ('a' - 10); + } + } + if (j == 0xffffffff) { + return -1; /* so that it works with 8-byte ints */ + } + else { + return j; } - if (j == 0xffffffff) - return -1; /* so that it works with 8-byte ints */ - else - return j; } /* @@ -482,12 +478,14 @@ PROXY_DECLARE(void) ap_proxy_sec2hex(int t, char *y) unsigned int j = t; for (i = 7; i >= 0; i--) { - ch = j & 0xF; - j >>= 4; - if (ch >= 10) - y[i] = ch + ('A' - 10); - else - y[i] = ch + '0'; + ch = j & 0xF; + j >>= 4; + if (ch >= 10) { + y[i] = ch + ('A' - 10); + } + else { + y[i] = ch + '0'; + } } y[8] = '\0'; } @@ -520,21 +518,22 @@ static const char * char *url, *user = NULL, *password = NULL, *err, *host; apr_port_t port; - if (r->hostname != NULL) - return r->hostname; + if (r->hostname != NULL) { + return r->hostname; + } /* Set url to the first char after "scheme://" */ - if ((url = strchr(r->uri, ':')) == NULL - || url[1] != '/' || url[2] != '/') - return NULL; + if ((url = strchr(r->uri, ':')) == NULL || url[1] != '/' || url[2] != '/') { + return NULL; + } url = apr_pstrdup(r->pool, &url[1]); /* make it point to "//", which is what proxy_canon_netloc expects */ err = ap_proxy_canon_netloc(r->pool, &url, &user, &password, &host, &port); - if (err != NULL) - ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, - "%s", err); + if (err != NULL) { + ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "%s", err); + } r->hostname = host; @@ -567,89 +566,99 @@ PROXY_DECLARE(int) ap_proxy_is_ipaddr(struct dirconn_entry *This, apr_pool_t *p) /* Iterate over up to 4 (dotted) quads. */ for (quads = 0; quads < 4 && *addr != '\0'; ++quads) { - char *tmp; + char *tmp; - if (*addr == '/' && quads > 0) /* netmask starts here. */ - break; + if (*addr == '/' && quads > 0) { /* netmask starts here. */ + break; + } - if (!apr_isdigit(*addr)) - return 0; /* no digit at start of quad */ + if (!apr_isdigit(*addr)) { + return 0; /* no digit at start of quad */ + } - ip_addr[quads] = strtol(addr, &tmp, 0); + ip_addr[quads] = strtol(addr, &tmp, 0); - if (tmp == addr) /* expected a digit, found something else */ - return 0; + if (tmp == addr) { /* expected a digit, found something else */ + return 0; + } - if (ip_addr[quads] < 0 || ip_addr[quads] > 255) { - /* invalid octet */ - return 0; - } + if (ip_addr[quads] < 0 || ip_addr[quads] > 255) { + /* invalid octet */ + return 0; + } - addr = tmp; + addr = tmp; - if (*addr == '.' && quads != 3) - ++addr; /* after the 4th quad, a dot would be illegal */ + if (*addr == '.' && quads != 3) { + ++addr; /* after the 4th quad, a dot would be illegal */ + } } - for (This->addr.s_addr = 0, i = 0; i < quads; ++i) - This->addr.s_addr |= htonl(ip_addr[i] << (24 - 8 * i)); + for (This->addr.s_addr = 0, i = 0; i < quads; ++i) { + This->addr.s_addr |= htonl(ip_addr[i] << (24 - 8 * i)); + } if (addr[0] == '/' && apr_isdigit(addr[1])) { /* net mask follows: */ - char *tmp; + char *tmp; - ++addr; + ++addr; - bits = strtol(addr, &tmp, 0); + bits = strtol(addr, &tmp, 0); - if (tmp == addr) /* expected a digit, found something else */ - return 0; + if (tmp == addr) { /* expected a digit, found something else */ + return 0; + } - addr = tmp; + addr = tmp; - if (bits < 0 || bits > 32) /* netmask must be between 0 and 32 */ - return 0; + if (bits < 0 || bits > 32) { /* netmask must be between 0 and 32 */ + return 0; + } } else { - /* - * Determine (i.e., "guess") netmask by counting the - * number of trailing .0's; reduce #quads appropriately - * (so that 192.168.0.0 is equivalent to 192.168.) - */ - while (quads > 0 && ip_addr[quads - 1] == 0) - --quads; + /* + * Determine (i.e., "guess") netmask by counting the + * number of trailing .0's; reduce #quads appropriately + * (so that 192.168.0.0 is equivalent to 192.168.) + */ + while (quads > 0 && ip_addr[quads - 1] == 0) { + --quads; + } - /* "IP Address should be given in dotted-quad form, optionally followed by a netmask (e.g., 192.168.111.0/24)"; */ - if (quads < 1) - return 0; + /* "IP Address should be given in dotted-quad form, optionally followed by a netmask (e.g., 192.168.111.0/24)"; */ + if (quads < 1) { + return 0; + } - /* every zero-byte counts as 8 zero-bits */ - bits = 8 * quads; + /* every zero-byte counts as 8 zero-bits */ + bits = 8 * quads; - if (bits != 32) /* no warning for fully qualified IP address */ + if (bits != 32) { /* no warning for fully qualified IP address */ ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, - "Warning: NetMask not supplied with IP-Addr; guessing: %s/%ld", - inet_ntoa(This->addr), bits); + "Warning: NetMask not supplied with IP-Addr; guessing: %s/%ld", + inet_ntoa(This->addr), bits); + } } This->mask.s_addr = htonl(APR_INADDR_NONE << (32 - bits)); if (*addr == '\0' && (This->addr.s_addr & ~This->mask.s_addr) != 0) { ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, - "Warning: NetMask and IP-Addr disagree in %s/%ld", - inet_ntoa(This->addr), bits); - This->addr.s_addr &= This->mask.s_addr; + "Warning: NetMask and IP-Addr disagree in %s/%ld", + inet_ntoa(This->addr), bits); + This->addr.s_addr &= This->mask.s_addr; ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, - " Set to %s/%ld", - inet_ntoa(This->addr), bits); + " Set to %s/%ld", inet_ntoa(This->addr), bits); } if (*addr == '\0') { - This->matcher = proxy_match_ipaddr; - return 1; + This->matcher = proxy_match_ipaddr; + return 1; + } + else { + return (*addr == '\0'); /* okay iff we've parsed the whole string */ } - else - return (*addr == '\0'); /* okay iff we've parsed the whole string */ } /* Return TRUE if addr represents an IP address (or an IP network address) */ @@ -659,80 +668,79 @@ static int proxy_match_ipaddr(struct dirconn_entry *This, request_rec *r) struct in_addr addr, *ip; const char *host = proxy_get_host_of_request(r); - if (host == NULL) /* oops! */ + if (host == NULL) { /* oops! */ return 0; + } memset(&addr, '\0', sizeof addr); memset(ip_addr, '\0', sizeof ip_addr); if (4 == sscanf(host, "%d.%d.%d.%d", &ip_addr[0], &ip_addr[1], &ip_addr[2], &ip_addr[3])) { - for (addr.s_addr = 0, i = 0; i < 4; ++i) - addr.s_addr |= htonl(ip_addr[i] << (24 - 8 * i)); + for (addr.s_addr = 0, i = 0; i < 4; ++i) { + addr.s_addr |= htonl(ip_addr[i] << (24 - 8 * i)); + } - if (This->addr.s_addr == (addr.s_addr & This->mask.s_addr)) { + if (This->addr.s_addr == (addr.s_addr & This->mask.s_addr)) { #if DEBUGGING - ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, + ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, "1)IP-Match: %s[%s] <-> ", host, inet_ntoa(addr)); - ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, + ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, "%s/", inet_ntoa(This->addr)); - ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, + ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, "%s", inet_ntoa(This->mask)); #endif - return 1; - } + return 1; + } #if DEBUGGING - else { - ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, + else { + ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, "1)IP-NoMatch: %s[%s] <-> ", host, inet_ntoa(addr)); - ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, + ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, "%s/", inet_ntoa(This->addr)); - ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, + ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, "%s", inet_ntoa(This->mask)); - } + } #endif } else { - struct apr_sockaddr_t *reqaddr; + struct apr_sockaddr_t *reqaddr; if (apr_sockaddr_info_get(&reqaddr, host, APR_UNSPEC, 0, 0, r->pool) - != APR_SUCCESS) { + != APR_SUCCESS) { #if DEBUGGING - ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, - "2)IP-NoMatch: hostname=%s msg=Host not found", - host); + ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, + "2)IP-NoMatch: hostname=%s msg=Host not found", host); #endif - return 0; - } + return 0; + } - /* Try to deal with multiple IP addr's for a host */ - /* FIXME: This needs to be able to deal with IPv6 */ - while (reqaddr) { - ip = (struct in_addr *) reqaddr->ipaddr_ptr; - if (This->addr.s_addr == (ip->s_addr & This->mask.s_addr)) { + /* Try to deal with multiple IP addr's for a host */ + /* FIXME: This needs to be able to deal with IPv6 */ + while (reqaddr) { + ip = (struct in_addr *) reqaddr->ipaddr_ptr; + if (This->addr.s_addr == (ip->s_addr & This->mask.s_addr)) { #if DEBUGGING - ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, - "3)IP-Match: %s[%s] <-> ", host, - inet_ntoa(*ip)); - ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, - "%s/", inet_ntoa(This->addr)); - ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, - "%s", inet_ntoa(This->mask)); + ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, + "3)IP-Match: %s[%s] <-> ", host, inet_ntoa(*ip)); + ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, + "%s/", inet_ntoa(This->addr)); + ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, + "%s", inet_ntoa(This->mask)); #endif - return 1; - } + return 1; + } #if DEBUGGING - else { + else { ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, - "3)IP-NoMatch: %s[%s] <-> ", host, - inet_ntoa(*ip)); + "3)IP-NoMatch: %s[%s] <-> ", host, inet_ntoa(*ip)); ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, - "%s/", inet_ntoa(This->addr)); + "%s/", inet_ntoa(This->addr)); ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, - "%s", inet_ntoa(This->mask)); - } + "%s", inet_ntoa(This->mask)); + } #endif - reqaddr = reqaddr->next; - } + reqaddr = reqaddr->next; + } } return 0; @@ -745,12 +753,14 @@ PROXY_DECLARE(int) ap_proxy_is_domainname(struct dirconn_entry *This, apr_pool_t int i; /* Domain name must start with a '.' */ - if (addr[0] != '.') + if (addr[0] != '.') { return 0; + } /* rfc1035 says DNS names must consist of "[-a-zA-Z0-9]" and '.' */ - for (i = 0; apr_isalnum(addr[i]) || addr[i] == '-' || addr[i] == '.'; ++i) + for (i = 0; apr_isalnum(addr[i]) || addr[i] == '-' || addr[i] == '.'; ++i) { continue; + } #if 0 if (addr[i] == ':') { @@ -760,12 +770,14 @@ PROXY_DECLARE(int) ap_proxy_is_domainname(struct dirconn_entry *This, apr_pool_t } #endif - if (addr[i] != '\0') + if (addr[i] != '\0') { return 0; + } /* Strip trailing dots */ - for (i = strlen(addr) - 1; i > 0 && addr[i] == '.'; --i) + for (i = strlen(addr) - 1; i > 0 && addr[i] == '.'; --i) { addr[i] = '\0'; + } This->matcher = proxy_match_domainname; return 1; @@ -777,17 +789,20 @@ static int proxy_match_domainname(struct dirconn_entry *This, request_rec *r) const char *host = proxy_get_host_of_request(r); int d_len = strlen(This->name), h_len; - if (host == NULL) /* some error was logged already */ + if (host == NULL) { /* some error was logged already */ return 0; + } h_len = strlen(host); /* @@@ do this within the setup? */ /* Ignore trailing dots in domain comparison: */ - while (d_len > 0 && This->name[d_len - 1] == '.') + while (d_len > 0 && This->name[d_len - 1] == '.') { --d_len; - while (h_len > 0 && host[h_len - 1] == '.') + } + while (h_len > 0 && host[h_len - 1] == '.') { --h_len; + } return h_len > d_len && strncasecmp(&host[h_len - d_len], This->name, d_len) == 0; } @@ -800,20 +815,22 @@ PROXY_DECLARE(int) ap_proxy_is_hostname(struct dirconn_entry *This, apr_pool_t * int i; /* Host names must not start with a '.' */ - if (host[0] == '.') + if (host[0] == '.') { return 0; - + } /* rfc1035 says DNS names must consist of "[-a-zA-Z0-9]" and '.' */ for (i = 0; apr_isalnum(host[i]) || host[i] == '-' || host[i] == '.'; ++i); - if (host[i] != '\0' || apr_sockaddr_info_get(&addr, host, APR_UNSPEC, 0, 0, p) != APR_SUCCESS) + if (host[i] != '\0' || apr_sockaddr_info_get(&addr, host, APR_UNSPEC, 0, 0, p) != APR_SUCCESS) { return 0; + } This->hostaddr = addr; /* Strip trailing dots */ - for (i = strlen(host) - 1; i > 0 && host[i] == '.'; --i) + for (i = strlen(host) - 1; i > 0 && host[i] == '.'; --i) { host[i] = '\0'; + } This->matcher = proxy_match_hostname; return 1; @@ -827,8 +844,9 @@ static int proxy_match_hostname(struct dirconn_entry *This, request_rec *r) int h2_len; int h1_len; - if (host == NULL || host2 == NULL) + if (host == NULL || host2 == NULL) { return 0; /* oops! */ + } h2_len = strlen(host2); h1_len = strlen(host); @@ -845,10 +863,12 @@ static int proxy_match_hostname(struct dirconn_entry *This, request_rec *r) #endif /* Ignore trailing dots in host2 comparison: */ - while (h2_len > 0 && host2[h2_len - 1] == '.') + while (h2_len > 0 && host2[h2_len - 1] == '.') { --h2_len; - while (h1_len > 0 && host[h1_len - 1] == '.') + } + while (h1_len > 0 && host[h1_len - 1] == '.') { --h1_len; + } return h1_len == h2_len && strncasecmp(host, host2, h1_len) == 0; } @@ -955,7 +975,10 @@ PROXY_DECLARE(apr_status_t) ap_proxy_string_read(conn_rec *c, apr_bucket_brigade *eos = 1; } else { - if (APR_SUCCESS != apr_bucket_read(e, (const char **)&response, &len, APR_BLOCK_READ)) { + if (APR_SUCCESS != (rv = apr_bucket_read(e, + (const char **)&response, + &len, + APR_BLOCK_READ))) { return rv; } /* @@ -1150,15 +1173,18 @@ PROXY_DECLARE(proxy_balancer *) ap_proxy_get_balancer(apr_pool_t *p, int i; c = strchr(uri, ':'); - if (c == NULL || c[1] != '/' || c[2] != '/' || c[3] == '\0') + if (c == NULL || c[1] != '/' || c[2] != '/' || c[3] == '\0') { return NULL; + } /* remove path from uri */ - if ((c = strchr(c + 3, '/'))) + if ((c = strchr(c + 3, '/'))) { *c = '\0'; + } balancer = (proxy_balancer *)conf->balancers->elts; for (i = 0; i < conf->balancers->nelts; i++) { - if (strcasecmp(balancer->name, uri) == 0) + if (strcasecmp(balancer->name, uri) == 0) { return balancer; + } balancer++; } return NULL; @@ -1215,14 +1241,16 @@ PROXY_DECLARE(proxy_worker *) ap_proxy_get_worker(apr_pool_t *p, proxy_worker *max_worker = NULL; int max_match = 0; int url_length; + int min_match; int worker_name_length; const char *c; char *url_copy; int i; c = ap_strchr_c(url, ':'); - if (c == NULL || c[1] != '/' || c[2] != '/' || c[3] == '\0') + if (c == NULL || c[1] != '/' || c[2] != '/' || c[3] == '\0') { return NULL; + } url_copy = apr_pstrdup(p, url); url_length = strlen(url); @@ -1239,19 +1267,25 @@ PROXY_DECLARE(proxy_worker *) ap_proxy_get_worker(apr_pool_t *p, pathstart = url_copy + (c - url); *pathstart = '\0'; ap_str_tolower(url_copy); + min_match = strlen(url_copy); *pathstart = '/'; - } else { + } + else { ap_str_tolower(url_copy); + min_match = strlen(url_copy); } worker = (proxy_worker *)conf->workers->elts; /* * Do a "longest match" on the worker name to find the worker that - * fits best to the URL. + * fits best to the URL, but keep in mind that we must have at least + * a minimum matching of length min_match such that + * scheme://hostname[:port] matches between worker and url. */ for (i = 0; i < conf->workers->nelts; i++) { if ( ((worker_name_length = strlen(worker->name)) <= url_length) + && (worker_name_length >= min_match) && (worker_name_length > max_match) && (strncmp(url_copy, worker->name, worker_name_length) == 0) ) { max_worker = worker; @@ -1419,11 +1453,10 @@ PROXY_DECLARE(int) ap_proxy_post_request(proxy_worker *worker, proxy_server_conf *conf) { int access_status; - if (balancer) + if (balancer) { access_status = proxy_run_post_request(worker, balancer, r, conf); + } else { - - access_status = OK; } @@ -1471,6 +1504,13 @@ PROXY_DECLARE(int) ap_proxy_connect_to_backend(apr_socket_t **newsock, } #endif + rv = apr_socket_opt_set(*newsock, APR_TCP_NODELAY, 1); + if (rv != APR_SUCCESS && rv != APR_ENOTIMPL) { + ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, + "apr_socket_opt_set(APR_TCP_NODELAY): " + "Failed to set"); + } + /* Set a timeout on the socket */ if (conf->timeout_set == 1) { apr_socket_timeout_set(*newsock, conf->timeout); @@ -1512,8 +1552,9 @@ static apr_status_t connection_cleanup(void *theconn) * If the connection pool is NULL the worker * cleanup has been run. Just return. */ - if (!worker->cp) + if (!worker->cp) { return APR_SUCCESS; + } #if APR_HAS_THREADS /* Sanity check: Did we already return the pooled connection? */ @@ -1545,7 +1586,7 @@ static apr_status_t connection_cleanup(void *theconn) worker->cp->conn = conn; } - /* Allways return the SUCCESS */ + /* Always return the SUCCESS */ return APR_SUCCESS; } @@ -1583,8 +1624,9 @@ static apr_status_t connection_destructor(void *resource, void *params, proxy_conn_rec *conn = (proxy_conn_rec *)resource; /* Destroy the pool only if not called from reslist_destroy */ - if (conn->worker->cp->pool) + if (conn->worker->cp->pool) { apr_pool_destroy(conn->pool); + } return APR_SUCCESS; } @@ -1646,14 +1688,18 @@ PROXY_DECLARE(void) ap_proxy_initialize_worker_share(proxy_server_conf *conf, worker->name); return; } - if (worker->route) + if (worker->route) { strcpy(worker->s->route, worker->route); - else + } + else { *worker->s->route = '\0'; - if (worker->redirect) + } + if (worker->redirect) { strcpy(worker->s->redirect, worker->redirect); - else + } + else { *worker->s->redirect = '\0'; + } worker->s->status |= (worker->status | PROXY_WORKER_INITIALIZED); @@ -1673,8 +1719,9 @@ PROXY_DECLARE(apr_status_t) ap_proxy_initialize_worker(proxy_worker *worker, ser } /* Set default parameters */ - if (!worker->retry) + if (!worker->retry) { worker->retry = apr_time_from_sec(PROXY_WORKER_DEFAULT_RETRY); + } /* By default address is reusable */ worker->is_address_reusable = 1; @@ -1682,13 +1729,16 @@ PROXY_DECLARE(apr_status_t) ap_proxy_initialize_worker(proxy_worker *worker, ser ap_mpm_query(AP_MPMQ_MAX_THREADS, &mpm_threads); if (mpm_threads > 1) { /* Set hard max to no more then mpm_threads */ - if (worker->hmax == 0 || worker->hmax > mpm_threads) + if (worker->hmax == 0 || worker->hmax > mpm_threads) { worker->hmax = mpm_threads; - if (worker->smax == 0 || worker->smax > worker->hmax) + } + if (worker->smax == 0 || worker->smax > worker->hmax) { worker->smax = worker->hmax; + } /* Set min to be lower then smax */ - if (worker->min > worker->smax) + if (worker->min > worker->smax) { worker->min = worker->smax; + } } else { /* This will supress the apr_reslist creation */ @@ -1712,8 +1762,9 @@ PROXY_DECLARE(apr_status_t) ap_proxy_initialize_worker(proxy_worker *worker, ser #if (APR_MAJOR_VERSION > 0) /* Set the acquire timeout */ - if (rv == APR_SUCCESS && worker->acquire_set) + if (rv == APR_SUCCESS && worker->acquire_set) { apr_reslist_timeout_set(worker->cp->res, worker->acquire); + } #endif } else @@ -1747,11 +1798,13 @@ PROXY_DECLARE(int) ap_proxy_retry_worker(const char *proxy_function, proxy_function, worker->hostname); return OK; } - else + else { return DECLINED; + } } - else + else { return OK; + } } PROXY_DECLARE(int) ap_proxy_acquire_connection(const char *proxy_function, @@ -1780,8 +1833,9 @@ PROXY_DECLARE(int) ap_proxy_acquire_connection(const char *proxy_function, #endif { /* create the new connection if the previous was destroyed */ - if (!worker->cp->conn) + if (!worker->cp->conn) { connection_constructor((void **)conn, worker, worker->cp->pool); + } else { *conn = worker->cp->conn; worker->cp->conn = NULL; @@ -1881,14 +1935,15 @@ ap_proxy_determine_connection(apr_pool_t *p, request_rec *r, * * TODO: Handle this much better... */ - if (!conn->hostname || !worker->is_address_reusable || + if (!conn->hostname || !worker->is_address_reusable || (r->connection->keepalives && (r->proxyreq == PROXYREQ_PROXY || r->proxyreq == PROXYREQ_REVERSE) && (strcasecmp(conn->hostname, uri->hostname) != 0) ) ) { if (proxyname) { conn->hostname = apr_pstrdup(conn->pool, proxyname); conn->port = proxyport; - } else { + } + else { conn->hostname = apr_pstrdup(conn->pool, uri->hostname); conn->port = uri->port; } @@ -1928,8 +1983,9 @@ ap_proxy_determine_connection(apr_pool_t *p, request_rec *r, "proxy: unlock"); } } - else + else { conn->addr = worker->cp->addr; + } if (err != APR_SUCCESS) { return ap_proxyerror(r, HTTP_BAD_GATEWAY, @@ -1942,7 +1998,8 @@ ap_proxy_determine_connection(apr_pool_t *p, request_rec *r, server_port = ap_get_server_port(r); if (ap_is_default_port(server_port, r)) { strcpy(server_portstr,""); - } else { + } + else { apr_snprintf(server_portstr, server_portstr_size, ":%d", server_port); } @@ -1958,6 +2015,51 @@ ap_proxy_determine_connection(apr_pool_t *p, request_rec *r, return OK; } +#define USE_ALTERNATE_IS_CONNECTED 1 + +#if !defined(APR_MSG_PEEK) && defined(MSG_PEEK) +#define APR_MSG_PEEK MSG_PEEK +#endif + +#if USE_ALTERNATE_IS_CONNECTED && defined(APR_MSG_PEEK) +static int is_socket_connected(apr_socket_t *socket) +{ + apr_pollfd_t pfds[1]; + apr_status_t status; + apr_int32_t nfds; + + pfds[0].reqevents = APR_POLLIN; + pfds[0].desc_type = APR_POLL_SOCKET; + pfds[0].desc.s = socket; + + do { + status = apr_poll(&pfds[0], 1, &nfds, 0); + } while (APR_STATUS_IS_EINTR(status)); + + if (status == APR_SUCCESS && nfds == 1 && + pfds[0].rtnevents == APR_POLLIN) { + apr_sockaddr_t unused; + apr_size_t len = 1; + char buf[1]; + /* The socket might be closed in which case + * the poll will return POLLIN. + * If there is no data available the socket + * is closed. + */ + status = apr_socket_recvfrom(&unused, socket, APR_MSG_PEEK, + &buf[0], &len); + if (status == APR_SUCCESS && len) + return 1; + else + return 0; + } + else if (APR_STATUS_IS_EAGAIN(status)) { + return 1; + } + return 0; + +} +#else static int is_socket_connected(apr_socket_t *sock) { @@ -1979,6 +2081,7 @@ static int is_socket_connected(apr_socket_t *sock) else return 1; } +#endif /* USE_ALTERNATE_IS_CONNECTED */ PROXY_DECLARE(int) ap_proxy_connect_backend(const char *proxy_function, proxy_conn_rec *conn, @@ -1990,6 +2093,9 @@ PROXY_DECLARE(int) ap_proxy_connect_backend(const char *proxy_function, int loglevel; apr_sockaddr_t *backend_addr = conn->addr; apr_socket_t *newsock; + void *sconf = s->module_config; + proxy_server_conf *conf = + (proxy_server_conf *) ap_get_module_config(sconf, &proxy_module); if (conn->sock) { /* @@ -2000,6 +2106,9 @@ PROXY_DECLARE(int) ap_proxy_connect_backend(const char *proxy_function, if (!(connected = is_socket_connected(conn->sock))) { apr_socket_close(conn->sock); conn->sock = NULL; + ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, + "proxy: %s: backend socket is disconnected.", + proxy_function); } } while (backend_addr && !connected) { @@ -2031,10 +2140,20 @@ PROXY_DECLARE(int) ap_proxy_connect_backend(const char *proxy_function, } #endif + rv = apr_socket_opt_set(newsock, APR_TCP_NODELAY, 1); + if (rv != APR_SUCCESS && rv != APR_ENOTIMPL) { + ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, + "apr_socket_opt_set(APR_TCP_NODELAY): " + "Failed to set"); + } + /* Set a timeout on the socket */ if (worker->timeout_set == 1) { apr_socket_timeout_set(newsock, worker->timeout); } + else if (conf->timeout_set == 1) { + apr_socket_timeout_set(newsock, conf->timeout); + } else { apr_socket_timeout_set(newsock, s->timeout); } @@ -2098,6 +2217,7 @@ PROXY_DECLARE(int) ap_proxy_connection_create(const char *proxy_function, { apr_sockaddr_t *backend_addr = conn->addr; int rc; + apr_interval_time_t current_timeout; /* * The socket is now open, create a new backend server connection @@ -2147,6 +2267,12 @@ PROXY_DECLARE(int) ap_proxy_connection_create(const char *proxy_function, "proxy: %s: connection complete to %pI (%s)", proxy_function, backend_addr, conn->hostname); + /* + * save the timout of the socket because core_pre_connection + * will set it to base_server->timeout + * (core TimeOut directive). + */ + apr_socket_timeout_get(conn->sock, ¤t_timeout); /* set up the connection filters */ rc = ap_run_pre_connection(conn->connection, conn->sock); if (rc != OK && rc != DONE) { @@ -2156,6 +2282,7 @@ PROXY_DECLARE(int) ap_proxy_connection_create(const char *proxy_function, proxy_function, rc); return rc; } + apr_socket_timeout_set(conn->sock, current_timeout); return OK; } diff --git a/modules/ssl/NWGNUmakefile b/modules/ssl/NWGNUmakefile index 601fda98..655cdd69 100644 --- a/modules/ssl/NWGNUmakefile +++ b/modules/ssl/NWGNUmakefile @@ -25,6 +25,7 @@ include $(AP_WORK)\build\NWGNUhead.inc OSSLINC = $(OSSLSDK)/outinc_nw_libc OSSLLIB = $(OSSLSDK)/out_nw_libc +OSSLAPP = $(OSSLSDK)/apps # # These directories will be at the beginning of the include list, followed by @@ -271,7 +272,9 @@ nlms :: libs $(TARGET_nlm) # correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) # install :: nlms FORCE - copy $(OBJDIR)\mod_ssl.nlm $(INSTALL)\Apache2\modules\*.* + copy $(OBJDIR)\mod_ssl.nlm $(INSTALL)\$(BASEDIR)\modules\*.* + -copy $(subst /,\,$(OSSLLIB))\openssl.nlm $(INSTALL)\$(BASEDIR)\bin\*.* + -copy $(subst /,\,$(OSSLAPP))\openssl.cnf $(INSTALL)\$(BASEDIR)\bin\*.* # # Any specialized rules here @@ -296,4 +299,3 @@ ssl_expr_scan.c : ssl_expr_scan.l include $(AP_WORK)\build\NWGNUtail.inc - diff --git a/modules/ssl/mod_ssl.dsp b/modules/ssl/mod_ssl.dsp index 0767ef7e..95d41991 100644 --- a/modules/ssl/mod_ssl.dsp +++ b/modules/ssl/mod_ssl.dsp @@ -53,8 +53,14 @@ 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_ssl.so" /base:@..\..\os\win32\BaseAddr.ref,mod_ssl.so -# ADD LINK32 kernel32.lib user32.lib wsock32.lib ws2_32.lib advapi32.lib gdi32.lib libeay32.lib ssleay32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_ssl.so" /libpath:"../../srclib/openssl/out32dll" /libpath:"../../srclib/openssl/out32" /base:@..\..\os\win32\BaseAddr.ref,mod_ssl.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_ssl.so" /base:@..\..\os\win32\BaseAddr.ref,mod_ssl.so +# ADD LINK32 kernel32.lib user32.lib wsock32.lib ws2_32.lib advapi32.lib gdi32.lib libeay32.lib ssleay32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_ssl.so" /libpath:"../../srclib/openssl/out32dll" /libpath:"../../srclib/openssl/out32" /base:@..\..\os\win32\BaseAddr.ref,mod_ssl.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_ssl.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_ssl - Win32 Debug" @@ -79,8 +85,14 @@ 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_ssl.so" /base:@..\..\os\win32\BaseAddr.ref,mod_ssl.so -# ADD LINK32 kernel32.lib user32.lib wsock32.lib ws2_32.lib advapi32.lib gdi32.lib libeay32.lib ssleay32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Debug/mod_ssl.so" /libpath:"../../srclib/openssl/out32dll.dbg" /libpath:"../../srclib/openssl/out32.dbg" /libpath:"../../srclib/openssl/out32dll" /libpath:"../../srclib/openssl/out32" /base:@..\..\os\win32\BaseAddr.ref,mod_ssl.so +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_ssl.so" /base:@..\..\os\win32\BaseAddr.ref,mod_ssl.so +# ADD LINK32 kernel32.lib user32.lib wsock32.lib ws2_32.lib advapi32.lib gdi32.lib libeay32.lib ssleay32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Debug\mod_ssl.so" /libpath:"../../srclib/openssl/out32dll.dbg" /libpath:"../../srclib/openssl/out32.dbg" /libpath:"../../srclib/openssl/out32dll" /libpath:"../../srclib/openssl/out32" /base:@..\..\os\win32\BaseAddr.ref,mod_ssl.so +# Begin Special Build Tool +TargetPath=.\Debug\mod_ssl.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_ssl - Win32 Lexical" @@ -105,8 +117,14 @@ 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_ssl.so" /base:@..\..\os\win32\BaseAddr.ref,mod_ssl.so -# ADD LINK32 kernel32.lib user32.lib wsock32.lib ws2_32.lib advapi32.lib gdi32.lib libeay32.lib ssleay32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:"Release/mod_ssl.so" /libpath:"../../srclib/openssl/out32dll" /libpath:"../../srclib/openssl/out32" /base:@..\..\os\win32\BaseAddr.ref,mod_ssl.so /opt:ref +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /out:".\Release\mod_ssl.so" /base:@..\..\os\win32\BaseAddr.ref,mod_ssl.so +# ADD LINK32 kernel32.lib user32.lib wsock32.lib ws2_32.lib advapi32.lib gdi32.lib libeay32.lib ssleay32.lib /nologo /subsystem:windows /dll /incremental:no /debug /out:".\Release\mod_ssl.so" /libpath:"../../srclib/openssl/out32dll" /libpath:"../../srclib/openssl/out32" /base:@..\..\os\win32\BaseAddr.ref,mod_ssl.so /opt:ref +# Begin Special Build Tool +TargetPath=.\Release\mod_ssl.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 diff --git a/modules/ssl/ssl_engine_init.c b/modules/ssl/ssl_engine_init.c index 7eb8ffac..ff2a4946 100644 --- a/modules/ssl/ssl_engine_init.c +++ b/modules/ssl/ssl_engine_init.c @@ -34,42 +34,21 @@ ** _________________________________________________________________ */ -static char *ssl_add_version_component(apr_pool_t *p, - server_rec *s, - char *name) -{ - char *val = ssl_var_lookup(p, s, NULL, NULL, name); - - if (val && *val) { - ap_add_version_component(p, val); - } - - return val; -} - -static char *version_components[] = { - "SSL_VERSION_PRODUCT", - "SSL_VERSION_INTERFACE", - "SSL_VERSION_LIBRARY", - NULL -}; static void ssl_add_version_components(apr_pool_t *p, server_rec *s) { - char *vals[sizeof(version_components)/sizeof(char *)]; - int i; + char *modver = ssl_var_lookup(p, s, NULL, NULL, "SSL_VERSION_INTERFACE"); + char *libver = ssl_var_lookup(p, s, NULL, NULL, "SSL_VERSION_LIBRARY"); + char *incver = ssl_var_lookup(p, s, NULL, NULL, + "SSL_VERSION_LIBRARY_INTERFACE"); - for (i=0; version_components[i]; i++) { - vals[i] = ssl_add_version_component(p, s, - version_components[i]); - } + ap_add_version_component(p, modver); + ap_add_version_component(p, libver); ap_log_error(APLOG_MARK, APLOG_INFO, 0, s, - "Server: %s, Interface: %s, Library: %s", - AP_SERVER_BASEVERSION, - vals[1], /* SSL_VERSION_INTERFACE */ - vals[2]); /* SSL_VERSION_LIBRARY */ + "%s compiled against Server: %s, Library: %s", + modver, AP_SERVER_BASEVERSION, incver); } @@ -231,6 +210,10 @@ int ssl_init_Module(apr_pool_t *p, apr_pool_t *plog, } +#if APR_HAS_THREADS + ssl_util_thread_setup(p); +#endif + /* * SSL external crypto device ("engine") support */ @@ -238,10 +221,6 @@ int ssl_init_Module(apr_pool_t *p, apr_pool_t *plog, ssl_init_Engine(base_server, p); #endif -#if APR_HAS_THREADS - ssl_util_thread_setup(p); -#endif - ap_log_error(APLOG_MARK, APLOG_INFO, 0, s, "Init: Initialized %s library", SSL_LIBRARY_NAME); @@ -847,14 +826,14 @@ static void ssl_check_public_cert(server_rec *s, if (SSL_X509_getCN(ptemp, cert, &cn)) { int fnm_flags = APR_FNM_PERIOD|APR_FNM_CASE_BLIND; - if (apr_fnmatch_test(cn) && - (apr_fnmatch(cn, s->server_hostname, - fnm_flags) == APR_FNM_NOMATCH)) - { - ap_log_error(APLOG_MARK, APLOG_WARNING, 0, s, - "%s server certificate wildcard CommonName (CN) `%s' " - "does NOT match server name!?", - ssl_asn1_keystr(type), cn); + if (apr_fnmatch_test(cn)) { + if (apr_fnmatch(cn, s->server_hostname, + fnm_flags) == APR_FNM_NOMATCH) { + ap_log_error(APLOG_MARK, APLOG_WARNING, 0, s, + "%s server certificate wildcard CommonName " + "(CN) `%s' does NOT match server name!?", + ssl_asn1_keystr(type), cn); + } } else if (strNE(s->server_hostname, cn)) { ap_log_error(APLOG_MARK, APLOG_WARNING, 0, s, diff --git a/modules/ssl/ssl_engine_io.c b/modules/ssl/ssl_engine_io.c index fc191d33..f3917ea1 100644 --- a/modules/ssl/ssl_engine_io.c +++ b/modules/ssl/ssl_engine_io.c @@ -1722,6 +1722,16 @@ static void ssl_io_data_dump(server_rec *srvr, ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, srvr, "+-------------------------------------------------------------------------+"); for(i = 0 ; i< rows; i++) { +#if APR_CHARSET_EBCDIC + char ebcdic_text[DUMP_WIDTH]; + /* Determine how many bytes we are going to process in this row. */ + j = DUMP_WIDTH; + if ((i * DUMP_WIDTH + j) > len) + j = len % DUMP_WIDTH; + if (j == 0) j = DUMP_WIDTH; + memcpy(ebcdic_text, (char *)(s) + i * DUMP_WIDTH, j); + ap_xlate_proto_from_ascii(ebcdic_text, j); +#endif apr_snprintf(tmp, sizeof(tmp), "| %04x: ", i * DUMP_WIDTH); apr_cpystrn(buf, tmp, sizeof(buf)); for (j = 0; j < DUMP_WIDTH; j++) { @@ -1739,7 +1749,11 @@ static void ssl_io_data_dump(server_rec *srvr, apr_cpystrn(buf+strlen(buf), " ", sizeof(buf)-strlen(buf)); else { ch = ((unsigned char)*((char *)(s) + i * DUMP_WIDTH + j)) & 0xff; +#if APR_CHARSET_EBCDIC + apr_snprintf(tmp, sizeof(tmp), "%c", ((ch >= 0x20 /*' '*/) && (ch <= 0x7e /*'~'*/)) ? ebcdic_text[j] : '.'); +#else apr_snprintf(tmp, sizeof(tmp), "%c", ((ch >= ' ') && (ch <= '~')) ? ch : '.'); +#endif apr_cpystrn(buf+strlen(buf), tmp, sizeof(buf)-strlen(buf)); } } diff --git a/modules/ssl/ssl_engine_vars.c b/modules/ssl/ssl_engine_vars.c index 71f93e76..5d82a464 100644 --- a/modules/ssl/ssl_engine_vars.c +++ b/modules/ssl/ssl_engine_vars.c @@ -635,31 +635,41 @@ static void ssl_var_lookup_ssl_cipher_bits(SSL *ssl, int *usekeysize, int *algke static char *ssl_var_lookup_ssl_version(apr_pool_t *p, char *var) { + static char interface[] = "mod_ssl/" MOD_SSL_VERSION; + static char library_interface[] = SSL_LIBRARY_TEXT; + static char *library = NULL; char *result; - char *cp, *cp2; - - result = NULL; - - if (strEQ(var, "PRODUCT")) { -#if defined(SSL_PRODUCT_NAME) && defined(SSL_PRODUCT_VERSION) - result = apr_psprintf(p, "%s/%s", SSL_PRODUCT_NAME, SSL_PRODUCT_VERSION); -#else - result = NULL; -#endif - } - else if (strEQ(var, "INTERFACE")) { - result = apr_psprintf(p, "mod_ssl/%s", MOD_SSL_VERSION); - } - else if (strEQ(var, "LIBRARY")) { - result = apr_pstrdup(p, SSLeay_version(SSLEAY_VERSION)); - if ((cp = strchr(result, ' ')) != NULL) { + + if (!library) { + char *cp, *cp2; + library = apr_pstrdup(p, SSL_LIBRARY_DYNTEXT); + if ((cp = strchr(library, ' ')) != NULL) { *cp = '/'; if ((cp2 = strchr(cp, ' ')) != NULL) *cp2 = NUL; } + if ((cp = strchr(library_interface, ' ')) != NULL) { + *cp = '/'; + if ((cp2 = strchr(cp, ' ')) != NULL) + *cp2 = NUL; + } + } + + if (strEQ(var, "INTERFACE")) { + result = apr_pstrdup(p, interface); + } + else if (strEQ(var, "LIBRARY_INTERFACE")) { + result = apr_pstrdup(p, library_interface); + } + else if (strEQ(var, "LIBRARY")) { + result = apr_pstrdup(p, library); + } + else { + result = NULL; } return result; } + const char *ssl_ext_lookup(apr_pool_t *p, conn_rec *c, int peer, const char *oidnum) diff --git a/modules/ssl/ssl_util_ssl.h b/modules/ssl/ssl_util_ssl.h index 3ce86417..04bcbdc2 100644 --- a/modules/ssl/ssl_util_ssl.h +++ b/modules/ssl/ssl_util_ssl.h @@ -37,14 +37,27 @@ /** * Determine SSL library version number */ +#define SSL_NIBBLE(x,n) ((x >> (n * 4)) & 0xF) + #ifdef OPENSSL_VERSION_NUMBER #define SSL_LIBRARY_VERSION OPENSSL_VERSION_NUMBER #define SSL_LIBRARY_NAME "OpenSSL" #define SSL_LIBRARY_TEXT OPENSSL_VERSION_TEXT +#define SSL_LIBRARY_DYNTEXT SSLeay_version(SSLEAY_VERSION) +#elif defined(SSLC_VERSION_NUMBER) +#define SSL_LIBRARY_VERSION SSLC_VERSION_NUMBER +#define SSL_LIBRARY_NAME "SSL-C" +#define SSL_LIBRARY_TEXT { 'S', 'S', 'L', '-', 'C', ' ', \ + '0' + SSL_NIBBLE(SSLC_VERSION_NUMBER,3), '.', \ + '0' + SSL_NIBBLE(SSLC_VERSION_NUMBER,2), '.', \ + '0' + SSL_NIBBLE(SSLC_VERSION_NUMBER,1), '.', \ + '0' + SSL_NIBBLE(SSLC_VERSION_NUMBER,0), 0 } +#define SSL_LIBRARY_DYNTEXT SSLC_library_info(SSLC_INFO_VERSION) #elif !defined(SSL_LIBRARY_VERSION) #define SSL_LIBRARY_VERSION 0x0000 #define SSL_LIBRARY_NAME "OtherSSL" #define SSL_LIBRARY_TEXT "OtherSSL 0.0.0 00 XXX 0000" +#define SSL_LIBRARY_DYNTEXT "OtherSSL 0.0.0 00 XXX 0000" #endif /** |