mirror of
https://github.com/apache/httpd.git
synced 2025-08-08 15:02:10 +03:00
Remaining cleanup of ap_ -> apr_ and AP_ -> APR_ transformation...
see src/lib/apr/apr_compat.h for most details. Also a few minor nits to get Win32 to build. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86008 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -139,9 +139,9 @@ EXPORTS
|
|||||||
; ap_kill_cleanups_for_socket @132
|
; ap_kill_cleanups_for_socket @132
|
||||||
;ap_kill_timeout @133
|
;ap_kill_timeout @133
|
||||||
ap_log_assert @134
|
ap_log_assert @134
|
||||||
ap_log_error_old @135
|
; ap_log_error_old @135
|
||||||
ap_log_reason @136
|
; ap_log_reason @136
|
||||||
ap_log_unixerr @137
|
; ap_log_unixerr @137
|
||||||
; ap_make_array @138
|
; ap_make_array @138
|
||||||
ap_make_dirstr @139
|
ap_make_dirstr @139
|
||||||
ap_make_dirstr_parent @140
|
ap_make_dirstr_parent @140
|
||||||
@@ -279,7 +279,7 @@ EXPORTS
|
|||||||
ap_limit_section @272
|
ap_limit_section @272
|
||||||
ap_loaded_modules @273
|
ap_loaded_modules @273
|
||||||
ap_log_error @274
|
ap_log_error @274
|
||||||
ap_log_printf @275
|
; ap_log_printf @275
|
||||||
ap_log_rerror @276
|
ap_log_rerror @276
|
||||||
; ap_month_snames @277
|
; ap_month_snames @277
|
||||||
; ap_null_cleanup @278
|
; ap_null_cleanup @278
|
||||||
|
@@ -26,7 +26,6 @@ CFG=ApacheCore - Win32 Debug
|
|||||||
# PROP Scc_ProjName ""
|
# PROP Scc_ProjName ""
|
||||||
# PROP Scc_LocalPath ""
|
# PROP Scc_LocalPath ""
|
||||||
CPP=cl.exe
|
CPP=cl.exe
|
||||||
RSC=rc.exe
|
|
||||||
|
|
||||||
!IF "$(CFG)" == "ApacheCore - Win32 Release"
|
!IF "$(CFG)" == "ApacheCore - Win32 Release"
|
||||||
|
|
||||||
@@ -40,10 +39,11 @@ RSC=rc.exe
|
|||||||
# PROP Output_Dir "LibR"
|
# PROP Output_Dir "LibR"
|
||||||
# PROP Intermediate_Dir "LibR"
|
# PROP Intermediate_Dir "LibR"
|
||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I ".\include" /I ".\lib\apr\include" /I ".\os\win32" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "API_EXPORT_SYMBOLS" /FD /c
|
RSC=rc.exe
|
||||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I ".\include" /I ".\lib\apr\include" /I ".\os\win32" /I ".\modules\mpm\winnt" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "API_EXPORT_SYMBOLS" /FD /c
|
|
||||||
# ADD BASE RSC /l 0x409
|
# ADD BASE RSC /l 0x409
|
||||||
# ADD RSC /l 0x409
|
# ADD RSC /l 0x409
|
||||||
|
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I ".\include" /I ".\lib\apr\include" /I ".\os\win32" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "API_EXPORT_SYMBOLS" /FD /c
|
||||||
|
# ADD CPP /nologo /MD /W3 /GX /O2 /I ".\include" /I ".\lib\apr\include" /I ".\os\win32" /I ".\modules\mpm\winnt" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "API_EXPORT_SYMBOLS" /FD /c
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
# ADD BASE BSC32 /nologo
|
# ADD BASE BSC32 /nologo
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
@@ -64,10 +64,11 @@ LIB32=link.exe -lib
|
|||||||
# PROP Intermediate_Dir "LibD"
|
# PROP Intermediate_Dir "LibD"
|
||||||
# PROP Ignore_Export_Lib 0
|
# PROP Ignore_Export_Lib 0
|
||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /I ".\include" /I ".\lib\apr\include" /I ".\os\win32" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "API_EXPORT_SYMBOLS" /FD /c
|
RSC=rc.exe
|
||||||
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I ".\include" /I ".\lib\apr\include" /I ".\os\win32" /I ".\modules\mpm\winnt" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "API_EXPORT_SYMBOLS" /FD /c
|
|
||||||
# ADD BASE RSC /l 0x409
|
# ADD BASE RSC /l 0x409
|
||||||
# ADD RSC /l 0x409
|
# ADD RSC /l 0x409
|
||||||
|
# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /I ".\include" /I ".\lib\apr\include" /I ".\os\win32" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "API_EXPORT_SYMBOLS" /FD /c
|
||||||
|
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I ".\include" /I ".\lib\apr\include" /I ".\os\win32" /I ".\modules\mpm\winnt" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "API_EXPORT_SYMBOLS" /FD /c
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
# ADD BASE BSC32 /nologo
|
# ADD BASE BSC32 /nologo
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
@@ -370,10 +371,22 @@ SOURCE=.\modules\standard\mod_mime.h
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\modules\mpm\winnt\mpm.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\include\mpm_common.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\modules\mpm\winnt\mpm_default.h
|
SOURCE=.\modules\mpm\winnt\mpm_default.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\include\mpm_status.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\modules\mpm\winnt\mpm_winnt.h
|
SOURCE=.\modules\mpm\winnt\mpm_winnt.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
@@ -390,10 +403,18 @@ SOURCE=.\include\util_cfgtree.h
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\include\util_charset.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\include\util_date.h
|
SOURCE=.\include\util_date.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\include\util_ebcdic.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\include\util_md5.h
|
SOURCE=.\include\util_md5.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
@@ -58,7 +58,7 @@ CFG=InstallBin - Win32 Debug
|
|||||||
# PROP Use_Debug_Libraries 1
|
# PROP Use_Debug_Libraries 1
|
||||||
# PROP Output_Dir "Debug"
|
# PROP Output_Dir "Debug"
|
||||||
# PROP Intermediate_Dir "Debug"
|
# PROP Intermediate_Dir "Debug"
|
||||||
# PROP Cmd_Line "NMAKE /f makefile.win INSTDIR=.. SHORT=D LONG=Debug _install"
|
# PROP Cmd_Line "NMAKE /f makefile.win INSTDIR=e:\apache\apache-2.0 SHORT=D LONG=Debug _install"
|
||||||
# PROP Rebuild_Opt ""
|
# PROP Rebuild_Opt ""
|
||||||
# PROP Target_File "..\Apache.exe"
|
# PROP Target_File "..\Apache.exe"
|
||||||
# PROP Bsc_Name ".\apache.bsc"
|
# PROP Bsc_Name ".\apache.bsc"
|
||||||
|
31
httpd.dsp
31
httpd.dsp
@@ -26,7 +26,6 @@ CFG=ApacheCore - Win32 Debug
|
|||||||
# PROP Scc_ProjName ""
|
# PROP Scc_ProjName ""
|
||||||
# PROP Scc_LocalPath ""
|
# PROP Scc_LocalPath ""
|
||||||
CPP=cl.exe
|
CPP=cl.exe
|
||||||
RSC=rc.exe
|
|
||||||
|
|
||||||
!IF "$(CFG)" == "ApacheCore - Win32 Release"
|
!IF "$(CFG)" == "ApacheCore - Win32 Release"
|
||||||
|
|
||||||
@@ -40,10 +39,11 @@ RSC=rc.exe
|
|||||||
# PROP Output_Dir "LibR"
|
# PROP Output_Dir "LibR"
|
||||||
# PROP Intermediate_Dir "LibR"
|
# PROP Intermediate_Dir "LibR"
|
||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I ".\include" /I ".\lib\apr\include" /I ".\os\win32" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "API_EXPORT_SYMBOLS" /FD /c
|
RSC=rc.exe
|
||||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I ".\include" /I ".\lib\apr\include" /I ".\os\win32" /I ".\modules\mpm\winnt" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "API_EXPORT_SYMBOLS" /FD /c
|
|
||||||
# ADD BASE RSC /l 0x409
|
# ADD BASE RSC /l 0x409
|
||||||
# ADD RSC /l 0x409
|
# ADD RSC /l 0x409
|
||||||
|
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I ".\include" /I ".\lib\apr\include" /I ".\os\win32" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "API_EXPORT_SYMBOLS" /FD /c
|
||||||
|
# ADD CPP /nologo /MD /W3 /GX /O2 /I ".\include" /I ".\lib\apr\include" /I ".\os\win32" /I ".\modules\mpm\winnt" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "API_EXPORT_SYMBOLS" /FD /c
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
# ADD BASE BSC32 /nologo
|
# ADD BASE BSC32 /nologo
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
@@ -64,10 +64,11 @@ LIB32=link.exe -lib
|
|||||||
# PROP Intermediate_Dir "LibD"
|
# PROP Intermediate_Dir "LibD"
|
||||||
# PROP Ignore_Export_Lib 0
|
# PROP Ignore_Export_Lib 0
|
||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /I ".\include" /I ".\lib\apr\include" /I ".\os\win32" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "API_EXPORT_SYMBOLS" /FD /c
|
RSC=rc.exe
|
||||||
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I ".\include" /I ".\lib\apr\include" /I ".\os\win32" /I ".\modules\mpm\winnt" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "API_EXPORT_SYMBOLS" /FD /c
|
|
||||||
# ADD BASE RSC /l 0x409
|
# ADD BASE RSC /l 0x409
|
||||||
# ADD RSC /l 0x409
|
# ADD RSC /l 0x409
|
||||||
|
# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /I ".\include" /I ".\lib\apr\include" /I ".\os\win32" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "API_EXPORT_SYMBOLS" /FD /c
|
||||||
|
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I ".\include" /I ".\lib\apr\include" /I ".\os\win32" /I ".\modules\mpm\winnt" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "API_EXPORT_SYMBOLS" /FD /c
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
# ADD BASE BSC32 /nologo
|
# ADD BASE BSC32 /nologo
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
@@ -370,10 +371,22 @@ SOURCE=.\modules\standard\mod_mime.h
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\modules\mpm\winnt\mpm.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\include\mpm_common.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\modules\mpm\winnt\mpm_default.h
|
SOURCE=.\modules\mpm\winnt\mpm_default.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\include\mpm_status.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\modules\mpm\winnt\mpm_winnt.h
|
SOURCE=.\modules\mpm\winnt\mpm_winnt.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
@@ -390,10 +403,18 @@ SOURCE=.\include\util_cfgtree.h
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\include\util_charset.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\include\util_date.h
|
SOURCE=.\include\util_date.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\include\util_ebcdic.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\include\util_md5.h
|
SOURCE=.\include\util_md5.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
@@ -56,7 +56,7 @@
|
|||||||
#define AP_AC_CONFIG_H
|
#define AP_AC_CONFIG_H
|
||||||
|
|
||||||
#include "ap_mmn.h" /* MODULE_MAGIC_NUMBER_ */
|
#include "ap_mmn.h" /* MODULE_MAGIC_NUMBER_ */
|
||||||
#include "apr_lib.h" /* ap_isfoo() macros */
|
#include "apr_lib.h" /* apr_isfoo() macros */
|
||||||
|
|
||||||
/* Implemented flags for dynamic library bindings.
|
/* Implemented flags for dynamic library bindings.
|
||||||
*
|
*
|
||||||
|
@@ -105,7 +105,7 @@ void ap_reclaim_child_processes(int terminate);
|
|||||||
* @param ret The process id of the process that died
|
* @param ret The process id of the process that died
|
||||||
* @param p The pool to allocate out of
|
* @param p The pool to allocate out of
|
||||||
*/
|
*/
|
||||||
void ap_wait_or_timeout(ap_wait_t *status, apr_proc_t *ret, apr_pool_t *p);
|
void ap_wait_or_timeout(apr_wait_t *status, apr_proc_t *ret, apr_pool_t *p);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Log why a child died to the error log, if the child died without the
|
* Log why a child died to the error log, if the child died without the
|
||||||
@@ -113,7 +113,7 @@ void ap_wait_or_timeout(ap_wait_t *status, apr_proc_t *ret, apr_pool_t *p);
|
|||||||
* @param pid The child that has died
|
* @param pid The child that has died
|
||||||
* @param status The status returned from ap_wait_or_timeout
|
* @param status The status returned from ap_wait_or_timeout
|
||||||
*/
|
*/
|
||||||
void ap_process_child_status(apr_proc_t *pid, ap_wait_t status);
|
void ap_process_child_status(apr_proc_t *pid, apr_wait_t status);
|
||||||
|
|
||||||
#if defined(TCP_NODELAY) && !defined(MPE) && !defined(TPF)
|
#if defined(TCP_NODELAY) && !defined(MPE) && !defined(TPF)
|
||||||
/**
|
/**
|
||||||
|
@@ -67,7 +67,7 @@ extern "C" {
|
|||||||
|
|
||||||
API_EXPORT(char *) ap_md5(apr_pool_t *a, const unsigned char *string);
|
API_EXPORT(char *) ap_md5(apr_pool_t *a, const unsigned char *string);
|
||||||
API_EXPORT(char *) ap_md5_binary(apr_pool_t *a, const unsigned char *buf, int len);
|
API_EXPORT(char *) ap_md5_binary(apr_pool_t *a, const unsigned char *buf, int len);
|
||||||
API_EXPORT(char *) ap_md5contextTo64(apr_pool_t *p, ap_md5_ctx_t *context);
|
API_EXPORT(char *) ap_md5contextTo64(apr_pool_t *p, apr_md5_ctx_t *context);
|
||||||
#ifdef APACHE_XLATE
|
#ifdef APACHE_XLATE
|
||||||
API_EXPORT(char *) ap_md5digest(apr_pool_t *p, apr_file_t *infile,
|
API_EXPORT(char *) ap_md5digest(apr_pool_t *p, apr_file_t *infile,
|
||||||
apr_xlate_t *xlate);
|
apr_xlate_t *xlate);
|
||||||
|
@@ -139,9 +139,9 @@ EXPORTS
|
|||||||
; ap_kill_cleanups_for_socket @132
|
; ap_kill_cleanups_for_socket @132
|
||||||
;ap_kill_timeout @133
|
;ap_kill_timeout @133
|
||||||
ap_log_assert @134
|
ap_log_assert @134
|
||||||
ap_log_error_old @135
|
; ap_log_error_old @135
|
||||||
ap_log_reason @136
|
; ap_log_reason @136
|
||||||
ap_log_unixerr @137
|
; ap_log_unixerr @137
|
||||||
; ap_make_array @138
|
; ap_make_array @138
|
||||||
ap_make_dirstr @139
|
ap_make_dirstr @139
|
||||||
ap_make_dirstr_parent @140
|
ap_make_dirstr_parent @140
|
||||||
@@ -279,7 +279,7 @@ EXPORTS
|
|||||||
ap_limit_section @272
|
ap_limit_section @272
|
||||||
ap_loaded_modules @273
|
ap_loaded_modules @273
|
||||||
ap_log_error @274
|
ap_log_error @274
|
||||||
ap_log_printf @275
|
; ap_log_printf @275
|
||||||
ap_log_rerror @276
|
ap_log_rerror @276
|
||||||
; ap_month_snames @277
|
; ap_month_snames @277
|
||||||
; ap_null_cleanup @278
|
; ap_null_cleanup @278
|
||||||
|
@@ -156,7 +156,7 @@ static const char *order(cmd_parms *cmd, void *dv, const char *arg)
|
|||||||
|
|
||||||
static int is_ip(const char *host)
|
static int is_ip(const char *host)
|
||||||
{
|
{
|
||||||
while ((*host == '.') || ap_isdigit(*host))
|
while ((*host == '.') || apr_isdigit(*host))
|
||||||
host++;
|
host++;
|
||||||
return (*host == '\0');
|
return (*host == '\0');
|
||||||
}
|
}
|
||||||
@@ -193,7 +193,7 @@ static const char *allow_cmd(cmd_parms *cmd, void *dv, const char *from,
|
|||||||
*s++ = '\0';
|
*s++ = '\0';
|
||||||
|
|
||||||
if (!is_ip(where)
|
if (!is_ip(where)
|
||||||
|| (a->x.ip.net = ap_inet_addr(where)) == INADDR_NONE) {
|
|| (a->x.ip.net = apr_inet_addr(where)) == INADDR_NONE) {
|
||||||
a->type = T_FAIL;
|
a->type = T_FAIL;
|
||||||
return "syntax error in network portion of network/netmask";
|
return "syntax error in network portion of network/netmask";
|
||||||
}
|
}
|
||||||
@@ -205,7 +205,7 @@ static const char *allow_cmd(cmd_parms *cmd, void *dv, const char *from,
|
|||||||
}
|
}
|
||||||
/* is it in /a.b.c.d form? */
|
/* is it in /a.b.c.d form? */
|
||||||
if (strchr(s, '.')) {
|
if (strchr(s, '.')) {
|
||||||
mask = ap_inet_addr(s);
|
mask = apr_inet_addr(s);
|
||||||
if (mask == INADDR_NONE) {
|
if (mask == INADDR_NONE) {
|
||||||
a->type = T_FAIL;
|
a->type = T_FAIL;
|
||||||
return "syntax error in mask portion of network/netmask";
|
return "syntax error in mask portion of network/netmask";
|
||||||
@@ -224,7 +224,7 @@ static const char *allow_cmd(cmd_parms *cmd, void *dv, const char *from,
|
|||||||
a->x.ip.mask = mask;
|
a->x.ip.mask = mask;
|
||||||
a->x.ip.net = (a->x.ip.net & mask); /* pjr - This fixes PR 4770 */
|
a->x.ip.net = (a->x.ip.net & mask); /* pjr - This fixes PR 4770 */
|
||||||
}
|
}
|
||||||
else if (ap_isdigit(*where) && is_ip(where)) {
|
else if (apr_isdigit(*where) && is_ip(where)) {
|
||||||
/* legacy syntax for ip addrs: a.b.c. ==> a.b.c.0/24 for example */
|
/* legacy syntax for ip addrs: a.b.c. ==> a.b.c.0/24 for example */
|
||||||
int shift;
|
int shift;
|
||||||
char *t;
|
char *t;
|
||||||
@@ -238,11 +238,11 @@ static const char *allow_cmd(cmd_parms *cmd, void *dv, const char *from,
|
|||||||
shift = 24;
|
shift = 24;
|
||||||
while (*s) {
|
while (*s) {
|
||||||
t = s;
|
t = s;
|
||||||
if (!ap_isdigit(*t)) {
|
if (!apr_isdigit(*t)) {
|
||||||
a->type = T_FAIL;
|
a->type = T_FAIL;
|
||||||
return "invalid ip address";
|
return "invalid ip address";
|
||||||
}
|
}
|
||||||
while (ap_isdigit(*t)) {
|
while (apr_isdigit(*t)) {
|
||||||
++t;
|
++t;
|
||||||
}
|
}
|
||||||
if (*t == '.') {
|
if (*t == '.') {
|
||||||
|
@@ -174,8 +174,8 @@ typedef struct digest_config_struct {
|
|||||||
|
|
||||||
#define DFLT_ALGORITHM "MD5"
|
#define DFLT_ALGORITHM "MD5"
|
||||||
|
|
||||||
#define DFLT_NONCE_LIFE (300*AP_USEC_PER_SEC)
|
#define DFLT_NONCE_LIFE (300*APR_USEC_PER_SEC)
|
||||||
#define NEXTNONCE_DELTA (30*AP_USEC_PER_SEC)
|
#define NEXTNONCE_DELTA (30*APR_USEC_PER_SEC)
|
||||||
|
|
||||||
|
|
||||||
#define NONCE_TIME_LEN (((sizeof(apr_time_t)+2)/3)*4)
|
#define NONCE_TIME_LEN (((sizeof(apr_time_t)+2)/3)*4)
|
||||||
@@ -536,10 +536,10 @@ static const char *set_nonce_lifetime(cmd_parms *cmd, void *config,
|
|||||||
long lifetime;
|
long lifetime;
|
||||||
|
|
||||||
lifetime = strtol(t, &endptr, 10);
|
lifetime = strtol(t, &endptr, 10);
|
||||||
if (endptr < (t+strlen(t)) && !ap_isspace(*endptr))
|
if (endptr < (t+strlen(t)) && !apr_isspace(*endptr))
|
||||||
return apr_pstrcat(cmd->pool, "Invalid time in AuthDigestNonceLifetime: ", t, NULL);
|
return apr_pstrcat(cmd->pool, "Invalid time in AuthDigestNonceLifetime: ", t, NULL);
|
||||||
|
|
||||||
((digest_config_rec *) config)->nonce_lifetime = lifetime * AP_USEC_PER_SEC;
|
((digest_config_rec *) config)->nonce_lifetime = lifetime * APR_USEC_PER_SEC;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -599,7 +599,7 @@ static const char *set_shmem_size(cmd_parms *cmd, void *config,
|
|||||||
long size, min;
|
long size, min;
|
||||||
|
|
||||||
size = strtol(size_str, &endptr, 10);
|
size = strtol(size_str, &endptr, 10);
|
||||||
while (ap_isspace(*endptr)) endptr++;
|
while (apr_isspace(*endptr)) endptr++;
|
||||||
if (*endptr == '\0' || *endptr == 'b' || *endptr == 'B')
|
if (*endptr == '\0' || *endptr == 'b' || *endptr == 'B')
|
||||||
;
|
;
|
||||||
else if (*endptr == 'k' || *endptr == 'K')
|
else if (*endptr == 'k' || *endptr == 'K')
|
||||||
@@ -867,19 +867,19 @@ static int get_digest_rec(request_rec *r, digest_header_rec *resp)
|
|||||||
|
|
||||||
/* find key */
|
/* find key */
|
||||||
|
|
||||||
while (ap_isspace(auth_line[0])) auth_line++;
|
while (apr_isspace(auth_line[0])) auth_line++;
|
||||||
vk = 0;
|
vk = 0;
|
||||||
while (auth_line[0] != '=' && auth_line[0] != ','
|
while (auth_line[0] != '=' && auth_line[0] != ','
|
||||||
&& auth_line[0] != '\0' && !ap_isspace(auth_line[0]))
|
&& auth_line[0] != '\0' && !apr_isspace(auth_line[0]))
|
||||||
key[vk++] = *auth_line++;
|
key[vk++] = *auth_line++;
|
||||||
key[vk] = '\0';
|
key[vk] = '\0';
|
||||||
while (ap_isspace(auth_line[0])) auth_line++;
|
while (apr_isspace(auth_line[0])) auth_line++;
|
||||||
|
|
||||||
/* find value */
|
/* find value */
|
||||||
|
|
||||||
if (auth_line[0] == '=') {
|
if (auth_line[0] == '=') {
|
||||||
auth_line++;
|
auth_line++;
|
||||||
while (ap_isspace(auth_line[0])) auth_line++;
|
while (apr_isspace(auth_line[0])) auth_line++;
|
||||||
|
|
||||||
vv = 0;
|
vv = 0;
|
||||||
if (auth_line[0] == '\"') { /* quoted string */
|
if (auth_line[0] == '\"') { /* quoted string */
|
||||||
@@ -893,7 +893,7 @@ static int get_digest_rec(request_rec *r, digest_header_rec *resp)
|
|||||||
}
|
}
|
||||||
else { /* token */
|
else { /* token */
|
||||||
while (auth_line[0] != ',' && auth_line[0] != '\0'
|
while (auth_line[0] != ',' && auth_line[0] != '\0'
|
||||||
&& !ap_isspace(auth_line[0]))
|
&& !apr_isspace(auth_line[0]))
|
||||||
value[vv++] = *auth_line++;
|
value[vv++] = *auth_line++;
|
||||||
}
|
}
|
||||||
value[vv] = '\0';
|
value[vv] = '\0';
|
||||||
@@ -1369,7 +1369,7 @@ static int check_nc(const request_rec *r, const digest_header_rec *resp,
|
|||||||
return OK;
|
return OK;
|
||||||
|
|
||||||
nc = strtol(snc, &endptr, 16);
|
nc = strtol(snc, &endptr, 16);
|
||||||
if (endptr < (snc+strlen(snc)) && !ap_isspace(*endptr)) {
|
if (endptr < (snc+strlen(snc)) && !apr_isspace(*endptr)) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"Digest: invalid nc %s received - not a number", snc);
|
"Digest: invalid nc %s received - not a number", snc);
|
||||||
return !OK;
|
return !OK;
|
||||||
@@ -1433,8 +1433,8 @@ static int check_nonce(request_rec *r, digest_header_rec *resp,
|
|||||||
if (dt > conf->nonce_lifetime) {
|
if (dt > conf->nonce_lifetime) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 0,r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 0,r,
|
||||||
"Digest: user %s: nonce expired (%.2lf seconds old - max lifetime %.2lf) - sending new nonce",
|
"Digest: user %s: nonce expired (%.2lf seconds old - max lifetime %.2lf) - sending new nonce",
|
||||||
r->user, ((double)dt)/AP_USEC_PER_SEC,
|
r->user, ((double)dt)/APR_USEC_PER_SEC,
|
||||||
((double)(conf->nonce_lifetime))/AP_USEC_PER_SEC);
|
((double)(conf->nonce_lifetime))/APR_USEC_PER_SEC);
|
||||||
note_digest_auth_failure(r, conf, resp, 1);
|
note_digest_auth_failure(r, conf, resp, 1);
|
||||||
return HTTP_UNAUTHORIZED;
|
return HTTP_UNAUTHORIZED;
|
||||||
}
|
}
|
||||||
@@ -1928,7 +1928,7 @@ static int add_auth_info(request_rec *r)
|
|||||||
* Content-length is never set yet when we get here, and we can't
|
* Content-length is never set yet when we get here, and we can't
|
||||||
* calc the entity hash) it's best to just leave this #def'd out.
|
* calc the entity hash) it's best to just leave this #def'd out.
|
||||||
*/
|
*/
|
||||||
char date[AP_RFC822_DATE_LEN];
|
char date[APR_RFC822_DATE_LEN];
|
||||||
apr_rfc822_date(date, r->request_time);
|
apr_rfc822_date(date, r->request_time);
|
||||||
char *entity_info =
|
char *entity_info =
|
||||||
ap_md5(r->pool,
|
ap_md5(r->pool,
|
||||||
|
@@ -534,7 +534,7 @@ static char* ComposeHeaders(request_rec *r, char* data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
*value++ = '\0';
|
*value++ = '\0';
|
||||||
while (*value && ap_isspace(*value)) ++value;
|
while (*value && apr_isspace(*value)) ++value;
|
||||||
|
|
||||||
/* Check all the special-case headers. Similar to what
|
/* Check all the special-case headers. Similar to what
|
||||||
* ap_scan_script_header_err() does (see that function for
|
* ap_scan_script_header_err() does (see that function for
|
||||||
@@ -546,7 +546,7 @@ static char* ComposeHeaders(request_rec *r, char* data)
|
|||||||
/* Nuke trailing whitespace */
|
/* Nuke trailing whitespace */
|
||||||
char *tmp;
|
char *tmp;
|
||||||
char *endp = value + strlen(value) - 1;
|
char *endp = value + strlen(value) - 1;
|
||||||
while (endp > value && ap_isspace(*endp))
|
while (endp > value && apr_isspace(*endp))
|
||||||
*endp-- = '\0';
|
*endp-- = '\0';
|
||||||
|
|
||||||
tmp = apr_pstrdup (r->pool, value);
|
tmp = apr_pstrdup (r->pool, value);
|
||||||
|
2
modules/cache/mod_file_cache.c
vendored
2
modules/cache/mod_file_cache.c
vendored
@@ -360,7 +360,7 @@ static int file_cache_xlat(request_rec *r)
|
|||||||
sconf = ap_get_module_config(r->server->module_config, &file_cache_module);
|
sconf = ap_get_module_config(r->server->module_config, &file_cache_module);
|
||||||
|
|
||||||
/* we only operate when at least one cachefile directive was used */
|
/* we only operate when at least one cachefile directive was used */
|
||||||
if (ap_is_empty_table(sconf->files))
|
if (apr_is_empty_table(sconf->files))
|
||||||
return DECLINED;
|
return DECLINED;
|
||||||
|
|
||||||
res = ap_core_translate(r);
|
res = ap_core_translate(r);
|
||||||
|
@@ -248,8 +248,8 @@ static void dav_format_time(int style, apr_time_t sec, char *buf)
|
|||||||
/* 29 chars plus null term */
|
/* 29 chars plus null term */
|
||||||
sprintf(buf,
|
sprintf(buf,
|
||||||
"%s, %.2d %s %d %.2d:%.2d:%.2d GMT",
|
"%s, %.2d %s %d %.2d:%.2d:%.2d GMT",
|
||||||
ap_day_snames[tms.tm_wday],
|
apr_day_snames[tms.tm_wday],
|
||||||
tms.tm_mday, ap_month_snames[tms.tm_mon],
|
tms.tm_mday, apr_month_snames[tms.tm_mon],
|
||||||
tms.tm_year + 1900,
|
tms.tm_year + 1900,
|
||||||
tms.tm_hour, tms.tm_min, tms.tm_sec);
|
tms.tm_hour, tms.tm_min, tms.tm_sec);
|
||||||
}
|
}
|
||||||
|
@@ -191,7 +191,7 @@ static void *dav_merge_dir_config(apr_pool_t *p, void *base, void *overrides)
|
|||||||
|
|
||||||
newconf->d_params = apr_copy_table(p, parent->d_params);
|
newconf->d_params = apr_copy_table(p, parent->d_params);
|
||||||
apr_overlap_tables(newconf->d_params, child->d_params,
|
apr_overlap_tables(newconf->d_params, child->d_params,
|
||||||
AP_OVERLAP_TABLES_SET);
|
APR_OVERLAP_TABLES_SET);
|
||||||
|
|
||||||
return newconf;
|
return newconf;
|
||||||
}
|
}
|
||||||
@@ -1888,7 +1888,7 @@ static int process_mkcol_body(request_rec *r)
|
|||||||
else if (lenp) {
|
else if (lenp) {
|
||||||
const char *pos = lenp;
|
const char *pos = lenp;
|
||||||
|
|
||||||
while (ap_isdigit(*pos) || ap_isspace(*pos)) {
|
while (apr_isdigit(*pos) || apr_isspace(*pos)) {
|
||||||
++pos;
|
++pos;
|
||||||
}
|
}
|
||||||
if (*pos != '\0') {
|
if (*pos != '\0') {
|
||||||
|
@@ -329,7 +329,7 @@ otilde\365oslash\370ugrave\371uacute\372yacute\375" /* 6 */
|
|||||||
|
|
||||||
/* is it numeric ? */
|
/* is it numeric ? */
|
||||||
if (s[1] == '#') {
|
if (s[1] == '#') {
|
||||||
for (j = 2, val = 0; j < i && ap_isdigit(s[j]); j++) {
|
for (j = 2, val = 0; j < i && apr_isdigit(s[j]); j++) {
|
||||||
val = val * 10 + s[j] - '0';
|
val = val * 10 + s[j] - '0';
|
||||||
}
|
}
|
||||||
s += i;
|
s += i;
|
||||||
@@ -382,7 +382,7 @@ static char *get_tag(apr_pool_t *p, apr_file_t *in, char *tag, int tagbuf_len, i
|
|||||||
|
|
||||||
do { /* skip whitespace */
|
do { /* skip whitespace */
|
||||||
GET_CHAR(in, c, NULL, p);
|
GET_CHAR(in, c, NULL, p);
|
||||||
} while (ap_isspace(c));
|
} while (apr_isspace(c));
|
||||||
|
|
||||||
/* tags can't start with - */
|
/* tags can't start with - */
|
||||||
if (c == '-') {
|
if (c == '-') {
|
||||||
@@ -390,7 +390,7 @@ static char *get_tag(apr_pool_t *p, apr_file_t *in, char *tag, int tagbuf_len, i
|
|||||||
if (c == '-') {
|
if (c == '-') {
|
||||||
do {
|
do {
|
||||||
GET_CHAR(in, c, NULL, p);
|
GET_CHAR(in, c, NULL, p);
|
||||||
} while (ap_isspace(c));
|
} while (apr_isspace(c));
|
||||||
if (c == '>') {
|
if (c == '>') {
|
||||||
apr_cpystrn(tag, "done", tagbuf_len);
|
apr_cpystrn(tag, "done", tagbuf_len);
|
||||||
return tag;
|
return tag;
|
||||||
@@ -405,17 +405,17 @@ static char *get_tag(apr_pool_t *p, apr_file_t *in, char *tag, int tagbuf_len, i
|
|||||||
*t = '\0';
|
*t = '\0';
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (c == '=' || ap_isspace(c)) {
|
if (c == '=' || apr_isspace(c)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
*(t++) = ap_tolower(c);
|
*(t++) = apr_tolower(c);
|
||||||
GET_CHAR(in, c, NULL, p);
|
GET_CHAR(in, c, NULL, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
*t++ = '\0';
|
*t++ = '\0';
|
||||||
tag_val = t;
|
tag_val = t;
|
||||||
|
|
||||||
while (ap_isspace(c)) {
|
while (apr_isspace(c)) {
|
||||||
GET_CHAR(in, c, NULL, p); /* space before = */
|
GET_CHAR(in, c, NULL, p); /* space before = */
|
||||||
}
|
}
|
||||||
if (c != '=') {
|
if (c != '=') {
|
||||||
@@ -425,7 +425,7 @@ static char *get_tag(apr_pool_t *p, apr_file_t *in, char *tag, int tagbuf_len, i
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
GET_CHAR(in, c, NULL, p); /* space after = */
|
GET_CHAR(in, c, NULL, p); /* space after = */
|
||||||
} while (ap_isspace(c));
|
} while (apr_isspace(c));
|
||||||
|
|
||||||
/* we should allow a 'name' as a value */
|
/* we should allow a 'name' as a value */
|
||||||
|
|
||||||
@@ -470,7 +470,7 @@ static int get_directive(apr_file_t *in, char *dest, size_t len, apr_pool_t *p)
|
|||||||
/* skip initial whitespace */
|
/* skip initial whitespace */
|
||||||
while (1) {
|
while (1) {
|
||||||
GET_CHAR(in, c, 1, p);
|
GET_CHAR(in, c, 1, p);
|
||||||
if (!ap_isspace(c)) {
|
if (!apr_isspace(c)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -479,9 +479,9 @@ static int get_directive(apr_file_t *in, char *dest, size_t len, apr_pool_t *p)
|
|||||||
if (d - dest == (int)len) {
|
if (d - dest == (int)len) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
*d++ = ap_tolower(c);
|
*d++ = apr_tolower(c);
|
||||||
GET_CHAR(in, c, 1, p);
|
GET_CHAR(in, c, 1, p);
|
||||||
if (ap_isspace(c)) {
|
if (apr_isspace(c)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -544,7 +544,7 @@ static void parse_string(request_rec *r, const char *in, char *out,
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
start_of_var_name = in;
|
start_of_var_name = in;
|
||||||
while (ap_isalnum(*in) || *in == '_') {
|
while (apr_isalnum(*in) || *in == '_') {
|
||||||
++in;
|
++in;
|
||||||
}
|
}
|
||||||
end_of_var_name = in;
|
end_of_var_name = in;
|
||||||
@@ -1281,7 +1281,7 @@ static const char *get_ptoken(request_rec *r, const char *string, struct token *
|
|||||||
return (char *) NULL;
|
return (char *) NULL;
|
||||||
}
|
}
|
||||||
while ((ch = *string++)) {
|
while ((ch = *string++)) {
|
||||||
if (!ap_isspace(ch)) {
|
if (!apr_isspace(ch)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1370,7 +1370,7 @@ static const char *get_ptoken(request_rec *r, const char *string, struct token *
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!qs) {
|
if (!qs) {
|
||||||
if (ap_isspace(ch)) {
|
if (apr_isspace(ch)) {
|
||||||
goto TOKEN_DONE;
|
goto TOKEN_DONE;
|
||||||
}
|
}
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
@@ -2179,7 +2179,7 @@ static int handle_printenv(apr_file_t *in, request_rec *r, const char *error)
|
|||||||
{
|
{
|
||||||
char tag[MAX_STRING_LEN];
|
char tag[MAX_STRING_LEN];
|
||||||
char *tag_val;
|
char *tag_val;
|
||||||
apr_array_header_t *arr = ap_table_elts(r->subprocess_env);
|
apr_array_header_t *arr = apr_table_elts(r->subprocess_env);
|
||||||
apr_table_entry_t *elts = (apr_table_entry_t *)arr->elts;
|
apr_table_entry_t *elts = (apr_table_entry_t *)arr->elts;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -2452,7 +2452,7 @@ static int send_parsed_file(request_rec *r)
|
|||||||
* destroyed, that's dealt with in handle_include().
|
* destroyed, that's dealt with in handle_include().
|
||||||
*/
|
*/
|
||||||
r->subprocess_env = parent->subprocess_env;
|
r->subprocess_env = parent->subprocess_env;
|
||||||
ap_pool_join(parent->pool, r->pool);
|
apr_pool_join(parent->pool, r->pool);
|
||||||
r->finfo.mtime = parent->finfo.mtime;
|
r->finfo.mtime = parent->finfo.mtime;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@@ -183,7 +183,7 @@ static char c_by_encoding, c_by_type, c_by_path;
|
|||||||
* matches ".." or "../"). Hopefully this one call is significantly less
|
* matches ".." or "../"). Hopefully this one call is significantly less
|
||||||
* expensive than multiple strcmp() calls.
|
* expensive than multiple strcmp() calls.
|
||||||
*/
|
*/
|
||||||
static ap_inline int is_parent(const char *name)
|
static apr_inline int is_parent(const char *name)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Now, IFF the first two bytes are dots, and the third byte is either
|
* Now, IFF the first two bytes are dots, and the third byte is either
|
||||||
@@ -1128,7 +1128,7 @@ static char *find_title(request_rec *r)
|
|||||||
}
|
}
|
||||||
titlebuf[n] = '\0';
|
titlebuf[n] = '\0';
|
||||||
for (x = 0, p = 0; titlebuf[x]; x++) {
|
for (x = 0, p = 0; titlebuf[x]; x++) {
|
||||||
if (ap_toupper(titlebuf[x]) == find[p]) {
|
if (apr_toupper(titlebuf[x]) == find[p]) {
|
||||||
if (!find[++p]) {
|
if (!find[++p]) {
|
||||||
if ((p = ap_ind(&titlebuf[++x], '<')) != -1) {
|
if ((p = ap_ind(&titlebuf[++x], '<')) != -1) {
|
||||||
titlebuf[x + p] = '\0';
|
titlebuf[x + p] = '\0';
|
||||||
@@ -1179,8 +1179,8 @@ static struct ent *make_autoindex_entry(char *name, int autoindex_opts,
|
|||||||
p->alt = NULL;
|
p->alt = NULL;
|
||||||
p->desc = NULL;
|
p->desc = NULL;
|
||||||
p->lm = -1;
|
p->lm = -1;
|
||||||
p->key = ap_toupper(keyid);
|
p->key = apr_toupper(keyid);
|
||||||
p->ascending = (ap_toupper(direction) == D_ASCENDING);
|
p->ascending = (apr_toupper(direction) == D_ASCENDING);
|
||||||
p->version_sort = autoindex_opts & VERSION_SORT;
|
p->version_sort = autoindex_opts & VERSION_SORT;
|
||||||
|
|
||||||
if (autoindex_opts & FANCY_INDEXING) {
|
if (autoindex_opts & FANCY_INDEXING) {
|
||||||
@@ -1430,7 +1430,7 @@ static void output_directories(struct ent **ar, int n,
|
|||||||
if (!(autoindex_opts & SUPPRESS_LAST_MOD)) {
|
if (!(autoindex_opts & SUPPRESS_LAST_MOD)) {
|
||||||
if (ar[x]->lm != -1) {
|
if (ar[x]->lm != -1) {
|
||||||
char time_str[MAX_STRING_LEN];
|
char time_str[MAX_STRING_LEN];
|
||||||
ap_exploded_time_t ts;
|
apr_exploded_time_t ts;
|
||||||
apr_explode_localtime(&ts, ar[x]->lm);
|
apr_explode_localtime(&ts, ar[x]->lm);
|
||||||
apr_strftime(time_str, &rv, MAX_STRING_LEN,
|
apr_strftime(time_str, &rv, MAX_STRING_LEN,
|
||||||
"%d-%b-%Y %H:%M ", &ts);
|
"%d-%b-%Y %H:%M ", &ts);
|
||||||
|
@@ -181,7 +181,7 @@ static int log_scripterror(request_rec *r, cgi_server_conf * conf, int ret,
|
|||||||
{
|
{
|
||||||
apr_file_t *f = NULL;
|
apr_file_t *f = NULL;
|
||||||
apr_finfo_t finfo;
|
apr_finfo_t finfo;
|
||||||
char time_str[AP_CTIME_LEN];
|
char time_str[APR_CTIME_LEN];
|
||||||
|
|
||||||
ap_log_rerror(APLOG_MARK, show_errno|APLOG_ERR, errno, r,
|
ap_log_rerror(APLOG_MARK, show_errno|APLOG_ERR, errno, r,
|
||||||
"%s: %s", error, r->filename);
|
"%s: %s", error, r->filename);
|
||||||
@@ -227,13 +227,13 @@ static void log_script_err(request_rec *r, BUFF *script_err)
|
|||||||
static int log_script(request_rec *r, cgi_server_conf * conf, int ret,
|
static int log_script(request_rec *r, cgi_server_conf * conf, int ret,
|
||||||
char *dbuf, const char *sbuf, BUFF *script_in, BUFF *script_err)
|
char *dbuf, const char *sbuf, BUFF *script_in, BUFF *script_err)
|
||||||
{
|
{
|
||||||
apr_array_header_t *hdrs_arr = ap_table_elts(r->headers_in);
|
apr_array_header_t *hdrs_arr = apr_table_elts(r->headers_in);
|
||||||
apr_table_entry_t *hdrs = (apr_table_entry_t *) hdrs_arr->elts;
|
apr_table_entry_t *hdrs = (apr_table_entry_t *) hdrs_arr->elts;
|
||||||
char argsbuffer[HUGE_STRING_LEN];
|
char argsbuffer[HUGE_STRING_LEN];
|
||||||
apr_file_t *f = NULL;
|
apr_file_t *f = NULL;
|
||||||
int i;
|
int i;
|
||||||
apr_finfo_t finfo;
|
apr_finfo_t finfo;
|
||||||
char time_str[AP_CTIME_LEN];
|
char time_str[APR_CTIME_LEN];
|
||||||
|
|
||||||
if (!conf->logname ||
|
if (!conf->logname ||
|
||||||
((apr_stat(&finfo, ap_server_root_relative(r->pool, conf->logname), r->pool) == APR_SUCCESS)
|
((apr_stat(&finfo, ap_server_root_relative(r->pool, conf->logname), r->pool) == APR_SUCCESS)
|
||||||
@@ -267,7 +267,7 @@ static int log_script(request_rec *r, cgi_server_conf * conf, int ret,
|
|||||||
}
|
}
|
||||||
|
|
||||||
apr_puts("%response\n", f);
|
apr_puts("%response\n", f);
|
||||||
hdrs_arr = ap_table_elts(r->err_headers_out);
|
hdrs_arr = apr_table_elts(r->err_headers_out);
|
||||||
hdrs = (apr_table_entry_t *) hdrs_arr->elts;
|
hdrs = (apr_table_entry_t *) hdrs_arr->elts;
|
||||||
|
|
||||||
for (i = 0; i < hdrs_arr->nelts; ++i) {
|
for (i = 0; i < hdrs_arr->nelts; ++i) {
|
||||||
|
@@ -312,7 +312,7 @@ static int call_exec(request_rec *r, char *argv0, char **env, int shellcmd)
|
|||||||
return (pid);
|
return (pid);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cgid_maint(int reason, void *data, ap_wait_t status)
|
static void cgid_maint(int reason, void *data, apr_wait_t status)
|
||||||
{
|
{
|
||||||
#if APR_HAS_OTHER_CHILD
|
#if APR_HAS_OTHER_CHILD
|
||||||
int *sd = data;
|
int *sd = data;
|
||||||
@@ -739,7 +739,7 @@ static int log_scripterror(request_rec *r, cgid_server_conf * conf, int ret,
|
|||||||
static int log_script(request_rec *r, cgid_server_conf * conf, int ret,
|
static int log_script(request_rec *r, cgid_server_conf * conf, int ret,
|
||||||
char *dbuf, const char *sbuf, BUFF *script_in, BUFF *script_err)
|
char *dbuf, const char *sbuf, BUFF *script_in, BUFF *script_err)
|
||||||
{
|
{
|
||||||
apr_array_header_t *hdrs_arr = ap_table_elts(r->headers_in);
|
apr_array_header_t *hdrs_arr = apr_table_elts(r->headers_in);
|
||||||
apr_table_entry_t *hdrs = (apr_table_entry_t *) hdrs_arr->elts;
|
apr_table_entry_t *hdrs = (apr_table_entry_t *) hdrs_arr->elts;
|
||||||
char argsbuffer[HUGE_STRING_LEN];
|
char argsbuffer[HUGE_STRING_LEN];
|
||||||
apr_file_t *f = NULL;
|
apr_file_t *f = NULL;
|
||||||
@@ -781,7 +781,7 @@ static int log_script(request_rec *r, cgid_server_conf * conf, int ret,
|
|||||||
}
|
}
|
||||||
|
|
||||||
apr_puts("%response\n", f);
|
apr_puts("%response\n", f);
|
||||||
hdrs_arr = ap_table_elts(r->err_headers_out);
|
hdrs_arr = apr_table_elts(r->err_headers_out);
|
||||||
hdrs = (apr_table_entry_t *) hdrs_arr->elts;
|
hdrs = (apr_table_entry_t *) hdrs_arr->elts;
|
||||||
|
|
||||||
for (i = 0; i < hdrs_arr->nelts; ++i) {
|
for (i = 0; i < hdrs_arr->nelts; ++i) {
|
||||||
|
@@ -584,7 +584,7 @@ char *ap_response_code_string(request_rec *r, int error_index)
|
|||||||
|
|
||||||
|
|
||||||
/* Code from Harald Hanche-Olsen <hanche@imf.unit.no> */
|
/* Code from Harald Hanche-Olsen <hanche@imf.unit.no> */
|
||||||
static ap_inline void do_double_reverse (conn_rec *conn)
|
static apr_inline void do_double_reverse (conn_rec *conn)
|
||||||
{
|
{
|
||||||
struct hostent *hptr;
|
struct hostent *hptr;
|
||||||
|
|
||||||
@@ -2845,7 +2845,7 @@ static int default_handler(request_rec *r)
|
|||||||
apr_mmap_offset((void**)&addr, mm ,0);
|
apr_mmap_offset((void**)&addr, mm ,0);
|
||||||
|
|
||||||
if (d->content_md5 & 1) {
|
if (d->content_md5 & 1) {
|
||||||
ap_md5_ctx_t context;
|
apr_md5_ctx_t context;
|
||||||
|
|
||||||
apr_MD5Init(&context);
|
apr_MD5Init(&context);
|
||||||
#ifdef APACHE_XLATE
|
#ifdef APACHE_XLATE
|
||||||
|
@@ -669,7 +669,7 @@ API_EXPORT(char *) ap_make_etag(request_rec *r, int force_weak)
|
|||||||
* would be incorrect.
|
* would be incorrect.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
weak = ((r->request_time - r->mtime > AP_USEC_PER_SEC) && !force_weak) ? "" : "W/";
|
weak = ((r->request_time - r->mtime > APR_USEC_PER_SEC) && !force_weak) ? "" : "W/";
|
||||||
|
|
||||||
if (r->finfo.protection != 0) {
|
if (r->finfo.protection != 0) {
|
||||||
etag = apr_psprintf(r->pool,
|
etag = apr_psprintf(r->pool,
|
||||||
@@ -738,7 +738,7 @@ API_EXPORT(void) ap_set_etag(request_rec *r)
|
|||||||
API_EXPORT(void) ap_set_last_modified(request_rec *r)
|
API_EXPORT(void) ap_set_last_modified(request_rec *r)
|
||||||
{
|
{
|
||||||
apr_time_t mod_time = ap_rationalize_mtime(r, r->mtime);
|
apr_time_t mod_time = ap_rationalize_mtime(r, r->mtime);
|
||||||
char *datestr = apr_palloc(r->pool, AP_RFC822_DATE_LEN);
|
char *datestr = apr_palloc(r->pool, APR_RFC822_DATE_LEN);
|
||||||
apr_rfc822_date(datestr, mod_time);
|
apr_rfc822_date(datestr, mod_time);
|
||||||
apr_table_setn(r->headers_out, "Last-Modified", datestr);
|
apr_table_setn(r->headers_out, "Last-Modified", datestr);
|
||||||
}
|
}
|
||||||
@@ -1038,7 +1038,7 @@ static void get_mime_headers(request_rec *r)
|
|||||||
char *value;
|
char *value;
|
||||||
char *copy;
|
char *copy;
|
||||||
int len;
|
int len;
|
||||||
unsigned int fields_read = 0;
|
int fields_read = 0;
|
||||||
apr_table_t *tmp_headers;
|
apr_table_t *tmp_headers;
|
||||||
|
|
||||||
/* We'll use apr_overlap_tables later to merge these into r->headers_in. */
|
/* We'll use apr_overlap_tables later to merge these into r->headers_in. */
|
||||||
@@ -1088,7 +1088,7 @@ static void get_mime_headers(request_rec *r)
|
|||||||
apr_table_addn(tmp_headers, copy, value);
|
apr_table_addn(tmp_headers, copy, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
apr_overlap_tables(r->headers_in, tmp_headers, AP_OVERLAP_TABLES_MERGE);
|
apr_overlap_tables(r->headers_in, tmp_headers, APR_OVERLAP_TABLES_MERGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
request_rec *ap_read_request(conn_rec *conn)
|
request_rec *ap_read_request(conn_rec *conn)
|
||||||
@@ -1527,7 +1527,7 @@ API_EXPORT(void) ap_basic_http_header(request_rec *r)
|
|||||||
|
|
||||||
(void) checked_bputstrs(r, protocol, " ", r->status_line, CRLF, NULL);
|
(void) checked_bputstrs(r, protocol, " ", r->status_line, CRLF, NULL);
|
||||||
|
|
||||||
date = apr_palloc(r->pool, AP_RFC822_DATE_LEN);
|
date = apr_palloc(r->pool, APR_RFC822_DATE_LEN);
|
||||||
apr_rfc822_date(date, r->request_time);
|
apr_rfc822_date(date, r->request_time);
|
||||||
ap_send_header_field(r, "Date", date);
|
ap_send_header_field(r, "Date", date);
|
||||||
ap_send_header_field(r, "Server", ap_get_server_version());
|
ap_send_header_field(r, "Server", ap_get_server_version());
|
||||||
@@ -1675,14 +1675,14 @@ static int uniq_field_values(void *d, const char *key, const char *val)
|
|||||||
do {
|
do {
|
||||||
/* Find a non-empty fieldname */
|
/* Find a non-empty fieldname */
|
||||||
|
|
||||||
while (*e == ',' || ap_isspace(*e)) {
|
while (*e == ',' || apr_isspace(*e)) {
|
||||||
++e;
|
++e;
|
||||||
}
|
}
|
||||||
if (*e == '\0') {
|
if (*e == '\0') {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
start = e;
|
start = e;
|
||||||
while (*e != '\0' && *e != ',' && !ap_isspace(*e)) {
|
while (*e != '\0' && *e != ',' && !apr_isspace(*e)) {
|
||||||
++e;
|
++e;
|
||||||
}
|
}
|
||||||
if (*e != '\0') {
|
if (*e != '\0') {
|
||||||
@@ -1764,7 +1764,7 @@ API_EXPORT(void) ap_send_http_header(request_rec *r)
|
|||||||
* header field tables into a single table. If we don't do this, our
|
* header field tables into a single table. If we don't do this, our
|
||||||
* later attempts to set or unset a given fieldname might be bypassed.
|
* later attempts to set or unset a given fieldname might be bypassed.
|
||||||
*/
|
*/
|
||||||
if (!ap_is_empty_table(r->err_headers_out))
|
if (!apr_is_empty_table(r->err_headers_out))
|
||||||
r->headers_out = apr_overlay_tables(r->pool, r->err_headers_out,
|
r->headers_out = apr_overlay_tables(r->pool, r->err_headers_out,
|
||||||
r->headers_out);
|
r->headers_out);
|
||||||
|
|
||||||
@@ -1820,7 +1820,7 @@ API_EXPORT(void) ap_send_http_header(request_rec *r)
|
|||||||
* some other part of the server configuration.
|
* some other part of the server configuration.
|
||||||
*/
|
*/
|
||||||
if (r->no_cache && !apr_table_get(r->headers_out, "Expires")) {
|
if (r->no_cache && !apr_table_get(r->headers_out, "Expires")) {
|
||||||
date = apr_palloc(r->pool, AP_RFC822_DATE_LEN);
|
date = apr_palloc(r->pool, APR_RFC822_DATE_LEN);
|
||||||
apr_rfc822_date(date, r->request_time);
|
apr_rfc822_date(date, r->request_time);
|
||||||
apr_table_addn(r->headers_out, "Expires", date);
|
apr_table_addn(r->headers_out, "Expires", date);
|
||||||
}
|
}
|
||||||
@@ -1921,7 +1921,7 @@ API_EXPORT(int) ap_setup_client_block(request_rec *r, int read_policy)
|
|||||||
{
|
{
|
||||||
const char *tenc = apr_table_get(r->headers_in, "Transfer-Encoding");
|
const char *tenc = apr_table_get(r->headers_in, "Transfer-Encoding");
|
||||||
const char *lenp = apr_table_get(r->headers_in, "Content-Length");
|
const char *lenp = apr_table_get(r->headers_in, "Content-Length");
|
||||||
unsigned long max_body;
|
long max_body;
|
||||||
|
|
||||||
r->read_body = read_policy;
|
r->read_body = read_policy;
|
||||||
r->read_chunked = 0;
|
r->read_chunked = 0;
|
||||||
@@ -1944,7 +1944,7 @@ API_EXPORT(int) ap_setup_client_block(request_rec *r, int read_policy)
|
|||||||
else if (lenp) {
|
else if (lenp) {
|
||||||
const char *pos = lenp;
|
const char *pos = lenp;
|
||||||
|
|
||||||
while (ap_isdigit(*pos) || ap_isspace(*pos))
|
while (apr_isdigit(*pos) || apr_isspace(*pos))
|
||||||
++pos;
|
++pos;
|
||||||
if (*pos != '\0') {
|
if (*pos != '\0') {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
@@ -2016,7 +2016,7 @@ static long get_chunk_size(char *b)
|
|||||||
{
|
{
|
||||||
long chunksize = 0;
|
long chunksize = 0;
|
||||||
|
|
||||||
while (ap_isxdigit(*b)) {
|
while (apr_isxdigit(*b)) {
|
||||||
int xvalue = 0;
|
int xvalue = 0;
|
||||||
|
|
||||||
if (*b >= '0' && *b <= '9')
|
if (*b >= '0' && *b <= '9')
|
||||||
@@ -2052,7 +2052,7 @@ API_EXPORT(long) ap_get_client_block(request_rec *r, char *buffer, int bufsiz)
|
|||||||
apr_size_t len_to_read;
|
apr_size_t len_to_read;
|
||||||
apr_ssize_t len_read;
|
apr_ssize_t len_read;
|
||||||
long chunk_start = 0;
|
long chunk_start = 0;
|
||||||
unsigned long max_body;
|
long max_body;
|
||||||
apr_status_t rv;
|
apr_status_t rv;
|
||||||
|
|
||||||
if (!r->read_chunked) { /* Content-length read */
|
if (!r->read_chunked) { /* Content-length read */
|
||||||
@@ -2098,7 +2098,7 @@ API_EXPORT(long) ap_get_client_block(request_rec *r, char *buffer, int bufsiz)
|
|||||||
|
|
||||||
chunk_start = getline(buffer, bufsiz, r->connection->client, 0);
|
chunk_start = getline(buffer, bufsiz, r->connection->client, 0);
|
||||||
if ((chunk_start <= 0) || (chunk_start >= (bufsiz - 1))
|
if ((chunk_start <= 0) || (chunk_start >= (bufsiz - 1))
|
||||||
|| !ap_isxdigit(*buffer)) {
|
|| !apr_isxdigit(*buffer)) {
|
||||||
r->connection->keepalive = -1;
|
r->connection->keepalive = -1;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -2641,7 +2641,7 @@ API_EXPORT(void) ap_send_error_response(request_rec *r, int recursive_error)
|
|||||||
* message body. Note that being assbackwards here is not an option.
|
* message body. Note that being assbackwards here is not an option.
|
||||||
*/
|
*/
|
||||||
if (status == HTTP_NOT_MODIFIED) {
|
if (status == HTTP_NOT_MODIFIED) {
|
||||||
if (!ap_is_empty_table(r->err_headers_out))
|
if (!apr_is_empty_table(r->err_headers_out))
|
||||||
r->headers_out = apr_overlay_tables(r->pool, r->err_headers_out,
|
r->headers_out = apr_overlay_tables(r->pool, r->err_headers_out,
|
||||||
r->headers_out);
|
r->headers_out);
|
||||||
ap_basic_http_header(r);
|
ap_basic_http_header(r);
|
||||||
@@ -2757,11 +2757,11 @@ API_EXPORT(void) ap_send_error_response(request_rec *r, int recursive_error)
|
|||||||
*/
|
*/
|
||||||
if (r->status_line != NULL
|
if (r->status_line != NULL
|
||||||
&& strlen(r->status_line) > 4 /* long enough */
|
&& strlen(r->status_line) > 4 /* long enough */
|
||||||
&& ap_isdigit(r->status_line[0])
|
&& apr_isdigit(r->status_line[0])
|
||||||
&& ap_isdigit(r->status_line[1])
|
&& apr_isdigit(r->status_line[1])
|
||||||
&& ap_isdigit(r->status_line[2])
|
&& apr_isdigit(r->status_line[2])
|
||||||
&& ap_isspace(r->status_line[3])
|
&& apr_isspace(r->status_line[3])
|
||||||
&& ap_isalnum(r->status_line[4])) {
|
&& apr_isalnum(r->status_line[4])) {
|
||||||
title = r->status_line;
|
title = r->status_line;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1297,7 +1297,7 @@ void ap_process_request(request_rec *r)
|
|||||||
|
|
||||||
static apr_table_t *rename_original_env(apr_pool_t *p, apr_table_t *t)
|
static apr_table_t *rename_original_env(apr_pool_t *p, apr_table_t *t)
|
||||||
{
|
{
|
||||||
apr_array_header_t *env_arr = ap_table_elts(t);
|
apr_array_header_t *env_arr = apr_table_elts(t);
|
||||||
apr_table_entry_t *elts = (apr_table_entry_t *) env_arr->elts;
|
apr_table_entry_t *elts = (apr_table_entry_t *) env_arr->elts;
|
||||||
apr_table_t *new = apr_make_table(p, env_arr->nalloc);
|
apr_table_t *new = apr_make_table(p, env_arr->nalloc);
|
||||||
int i;
|
int i;
|
||||||
|
@@ -78,14 +78,14 @@
|
|||||||
|
|
||||||
/* XXXX - fix me / EBCDIC
|
/* XXXX - fix me / EBCDIC
|
||||||
* there was a cludge here which would use its
|
* there was a cludge here which would use its
|
||||||
* own version ap_isascii(). Indicating that
|
* own version apr_isascii(). Indicating that
|
||||||
* on some platforms that might be needed.
|
* on some platforms that might be needed.
|
||||||
*
|
*
|
||||||
* #define OS_ASC(c) (c) -- for mere mortals
|
* #define OS_ASC(c) (c) -- for mere mortals
|
||||||
* or
|
* or
|
||||||
* #define OS_ASC(c) (ebcdic2ascii[c]) -- for dino's
|
* #define OS_ASC(c) (ebcdic2ascii[c]) -- for dino's
|
||||||
*
|
*
|
||||||
* #define ap_isascii(c) ((OS_ASC(c) & 0x80) == 0)
|
* #define apr_isascii(c) ((OS_ASC(c) & 0x80) == 0)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* XXXXX - fix me - See note with NOT_PROXY
|
/* XXXXX - fix me - See note with NOT_PROXY
|
||||||
@@ -313,7 +313,7 @@ AP_INIT_TAKE1("DefaultLanguage", ap_set_string_slot,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define MIME_HASHSIZE (32)
|
#define MIME_HASHSIZE (32)
|
||||||
#define hash(i) (ap_tolower(i) % MIME_HASHSIZE)
|
#define hash(i) (apr_tolower(i) % MIME_HASHSIZE)
|
||||||
|
|
||||||
static apr_table_t *hash_buckets[MIME_HASHSIZE];
|
static apr_table_t *hash_buckets[MIME_HASHSIZE];
|
||||||
|
|
||||||
@@ -381,7 +381,7 @@ static int is_token(char c)
|
|||||||
{
|
{
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
res = (ap_isascii(c) && ap_isgraph(c)
|
res = (apr_isascii(c) && apr_isgraph(c)
|
||||||
&& (strchr(tspecial, c) == NULL)) ? 1 : -1;
|
&& (strchr(tspecial, c) == NULL)) ? 1 : -1;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -390,7 +390,7 @@ static int is_qtext(char c)
|
|||||||
{
|
{
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
res = (ap_isascii(c) && (c != '"') && (c != '\\') && (c != '\n'))
|
res = (apr_isascii(c) && (c != '"') && (c != '\\') && (c != '\n'))
|
||||||
? 1 : -1;
|
? 1 : -1;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -402,7 +402,7 @@ static int is_quoted_pair(char *s)
|
|||||||
|
|
||||||
if (((s + 1) != NULL) && (*s == '\\')) {
|
if (((s + 1) != NULL) && (*s == '\\')) {
|
||||||
c = (int) *(s + 1);
|
c = (int) *(s + 1);
|
||||||
if (ap_isascii(c)) {
|
if (apr_isascii(c)) {
|
||||||
res = 1;
|
res = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -386,7 +386,7 @@ static const char *log_env_var(request_rec *r, char *a)
|
|||||||
|
|
||||||
static const char *log_request_time(request_rec *r, char *a)
|
static const char *log_request_time(request_rec *r, char *a)
|
||||||
{
|
{
|
||||||
ap_exploded_time_t xt;
|
apr_exploded_time_t xt;
|
||||||
apr_size_t retcode;
|
apr_size_t retcode;
|
||||||
char tstr[MAX_STRING_LEN];
|
char tstr[MAX_STRING_LEN];
|
||||||
|
|
||||||
@@ -423,7 +423,7 @@ static const char *log_request_time(request_rec *r, char *a)
|
|||||||
}
|
}
|
||||||
|
|
||||||
apr_snprintf(tstr, sizeof(tstr), "[%02d/%s/%d:%02d:%02d:%02d %c%.2d%.2d]",
|
apr_snprintf(tstr, sizeof(tstr), "[%02d/%s/%d:%02d:%02d:%02d %c%.2d%.2d]",
|
||||||
xt.tm_mday, ap_month_snames[xt.tm_mon], xt.tm_year+1900,
|
xt.tm_mday, apr_month_snames[xt.tm_mon], xt.tm_year+1900,
|
||||||
xt.tm_hour, xt.tm_min, xt.tm_sec,
|
xt.tm_hour, xt.tm_min, xt.tm_sec,
|
||||||
sign, timz / (60*60), timz % (60*60));
|
sign, timz / (60*60), timz % (60*60));
|
||||||
}
|
}
|
||||||
@@ -433,7 +433,8 @@ static const char *log_request_time(request_rec *r, char *a)
|
|||||||
|
|
||||||
static const char *log_request_duration(request_rec *r, char *a)
|
static const char *log_request_duration(request_rec *r, char *a)
|
||||||
{
|
{
|
||||||
return apr_psprintf(r->pool, "%lld", (apr_now() - r->request_time) / AP_USEC_PER_SEC);
|
return apr_psprintf(r->pool, "%lld", (apr_now() - r->request_time)
|
||||||
|
/ APR_USEC_PER_SEC);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* These next two routines use the canonical name:port so that log
|
/* These next two routines use the canonical name:port so that log
|
||||||
@@ -667,7 +668,7 @@ static char *parse_log_item(apr_pool_t *p, log_format_item *it, const char **sa)
|
|||||||
case '8':
|
case '8':
|
||||||
case '9':
|
case '9':
|
||||||
i = *s - '0';
|
i = *s - '0';
|
||||||
while (ap_isdigit(*++s)) {
|
while (apr_isdigit(*++s)) {
|
||||||
i = i * 10 + (*s) - '0';
|
i = i * 10 + (*s) - '0';
|
||||||
}
|
}
|
||||||
if (!it->conditions) {
|
if (!it->conditions) {
|
||||||
|
@@ -188,7 +188,7 @@ static const char *add_redirect_internal(cmd_parms *cmd,
|
|||||||
status = HTTP_MOVED_TEMPORARILY;
|
status = HTTP_MOVED_TEMPORARILY;
|
||||||
else if (!strcasecmp(arg1, "seeother"))
|
else if (!strcasecmp(arg1, "seeother"))
|
||||||
status = HTTP_SEE_OTHER;
|
status = HTTP_SEE_OTHER;
|
||||||
else if (ap_isdigit(*arg1))
|
else if (apr_isdigit(*arg1))
|
||||||
status = atoi(arg1);
|
status = atoi(arg1);
|
||||||
else {
|
else {
|
||||||
f = arg1;
|
f = arg1;
|
||||||
|
@@ -181,7 +181,7 @@ static int handle_dir(request_rec *r)
|
|||||||
if (ap_is_HTTP_REDIRECT(rr->status) ||
|
if (ap_is_HTTP_REDIRECT(rr->status) ||
|
||||||
(rr->status == HTTP_NOT_ACCEPTABLE && num_names == 1)) {
|
(rr->status == HTTP_NOT_ACCEPTABLE && num_names == 1)) {
|
||||||
|
|
||||||
ap_pool_join(r->pool, rr->pool);
|
apr_pool_join(r->pool, rr->pool);
|
||||||
error_notfound = rr->status;
|
error_notfound = rr->status;
|
||||||
r->notes = apr_overlay_tables(r->pool, r->notes, rr->notes);
|
r->notes = apr_overlay_tables(r->pool, r->notes, rr->notes);
|
||||||
r->headers_out = apr_overlay_tables(r->pool, r->headers_out,
|
r->headers_out = apr_overlay_tables(r->pool, r->headers_out,
|
||||||
|
@@ -274,7 +274,7 @@ static double get_x_coord(const char *args)
|
|||||||
return (-1); /* in case we aren't passed anything */
|
return (-1); /* in case we aren't passed anything */
|
||||||
}
|
}
|
||||||
|
|
||||||
while (*args && !ap_isdigit(*args) && *args != ',') {
|
while (*args && !apr_isdigit(*args) && *args != ',') {
|
||||||
args++; /* jump to the first digit, but not past
|
args++; /* jump to the first digit, but not past
|
||||||
a comma or end */
|
a comma or end */
|
||||||
}
|
}
|
||||||
@@ -306,7 +306,7 @@ static double get_y_coord(const char *args)
|
|||||||
start_of_y++; /* start looking at the character after
|
start_of_y++; /* start looking at the character after
|
||||||
the comma */
|
the comma */
|
||||||
|
|
||||||
while (*start_of_y && !ap_isdigit(*start_of_y)) {
|
while (*start_of_y && !apr_isdigit(*start_of_y)) {
|
||||||
start_of_y++; /* jump to the first digit, but not
|
start_of_y++; /* jump to the first digit, but not
|
||||||
past the end */
|
past the end */
|
||||||
}
|
}
|
||||||
@@ -337,7 +337,7 @@ static void read_quoted(char **string, char **quoted_part)
|
|||||||
/* assume there's no quoted part */
|
/* assume there's no quoted part */
|
||||||
*quoted_part = NULL;
|
*quoted_part = NULL;
|
||||||
|
|
||||||
while (ap_isspace(*strp)) {
|
while (apr_isspace(*strp)) {
|
||||||
strp++; /* go along string until non-whitespace */
|
strp++; /* go along string until non-whitespace */
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -396,7 +396,7 @@ static char *imap_url(request_rec *r, const char *base, const char *value)
|
|||||||
}
|
}
|
||||||
|
|
||||||
string_pos_const = value;
|
string_pos_const = value;
|
||||||
while (ap_isalpha(*string_pos_const)) {
|
while (apr_isalpha(*string_pos_const)) {
|
||||||
string_pos_const++; /* go along the URL from the map
|
string_pos_const++; /* go along the URL from the map
|
||||||
until a non-letter */
|
until a non-letter */
|
||||||
}
|
}
|
||||||
@@ -705,7 +705,7 @@ static int imap_handler(request_rec *r)
|
|||||||
}
|
}
|
||||||
|
|
||||||
directive = string_pos;
|
directive = string_pos;
|
||||||
while (*string_pos && !ap_isspace(*string_pos)) { /* past directive */
|
while (*string_pos && !apr_isspace(*string_pos)) { /* past directive */
|
||||||
++string_pos;
|
++string_pos;
|
||||||
}
|
}
|
||||||
if (!*string_pos) { /* need at least two fields */
|
if (!*string_pos) { /* need at least two fields */
|
||||||
@@ -716,15 +716,15 @@ static int imap_handler(request_rec *r)
|
|||||||
if (!*string_pos) { /* need at least two fields */
|
if (!*string_pos) { /* need at least two fields */
|
||||||
goto need_2_fields;
|
goto need_2_fields;
|
||||||
}
|
}
|
||||||
while(*string_pos && ap_isspace(*string_pos)) { /* past whitespace */
|
while(*string_pos && apr_isspace(*string_pos)) { /* past whitespace */
|
||||||
++string_pos;
|
++string_pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
value = string_pos;
|
value = string_pos;
|
||||||
while (*string_pos && !ap_isspace(*string_pos)) { /* past value */
|
while (*string_pos && !apr_isspace(*string_pos)) { /* past value */
|
||||||
++string_pos;
|
++string_pos;
|
||||||
}
|
}
|
||||||
if (ap_isspace(*string_pos)) {
|
if (apr_isspace(*string_pos)) {
|
||||||
*string_pos++ = '\0';
|
*string_pos++ = '\0';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -763,17 +763,17 @@ static int imap_handler(request_rec *r)
|
|||||||
sscanf(string_pos, "%lf%*[, ]%lf",
|
sscanf(string_pos, "%lf%*[, ]%lf",
|
||||||
&pointarray[vertex][X], &pointarray[vertex][Y]) == 2) {
|
&pointarray[vertex][X], &pointarray[vertex][Y]) == 2) {
|
||||||
/* Now skip what we just read... we can't use ANSIism %n */
|
/* Now skip what we just read... we can't use ANSIism %n */
|
||||||
while (ap_isspace(*string_pos)) { /* past whitespace */
|
while (apr_isspace(*string_pos)) { /* past whitespace */
|
||||||
string_pos++;
|
string_pos++;
|
||||||
}
|
}
|
||||||
while (ap_isdigit(*string_pos)) { /* and the 1st number */
|
while (apr_isdigit(*string_pos)) { /* and the 1st number */
|
||||||
string_pos++;
|
string_pos++;
|
||||||
}
|
}
|
||||||
string_pos++; /* skip the ',' */
|
string_pos++; /* skip the ',' */
|
||||||
while (ap_isspace(*string_pos)) { /* past any more whitespace */
|
while (apr_isspace(*string_pos)) { /* past any more whitespace */
|
||||||
string_pos++;
|
string_pos++;
|
||||||
}
|
}
|
||||||
while (ap_isdigit(*string_pos)) { /* 2nd number */
|
while (apr_isdigit(*string_pos)) { /* 2nd number */
|
||||||
string_pos++;
|
string_pos++;
|
||||||
}
|
}
|
||||||
vertex++;
|
vertex++;
|
||||||
|
@@ -372,8 +372,8 @@ static const char *get_entry(apr_pool_t *p, accept_rec *result,
|
|||||||
|
|
||||||
/* Look for 'var = value' --- and make sure the var is in lcase. */
|
/* Look for 'var = value' --- and make sure the var is in lcase. */
|
||||||
|
|
||||||
for (cp = parm; (*cp && !ap_isspace(*cp) && *cp != '='); ++cp) {
|
for (cp = parm; (*cp && !apr_isspace(*cp) && *cp != '='); ++cp) {
|
||||||
*cp = ap_tolower(*cp);
|
*cp = apr_tolower(*cp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!*cp) {
|
if (!*cp) {
|
||||||
@@ -381,7 +381,7 @@ static const char *get_entry(apr_pool_t *p, accept_rec *result,
|
|||||||
}
|
}
|
||||||
|
|
||||||
*cp++ = '\0'; /* Delimit var */
|
*cp++ = '\0'; /* Delimit var */
|
||||||
while (*cp && (ap_isspace(*cp) || *cp == '=')) {
|
while (*cp && (apr_isspace(*cp) || *cp == '=')) {
|
||||||
++cp;
|
++cp;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -392,7 +392,7 @@ static const char *get_entry(apr_pool_t *p, accept_rec *result,
|
|||||||
end++);
|
end++);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for (end = cp; (*end && !ap_isspace(*end)); end++);
|
for (end = cp; (*end && !apr_isspace(*end)); end++);
|
||||||
}
|
}
|
||||||
if (*end) {
|
if (*end) {
|
||||||
*end = '\0'; /* strip ending quote or return */
|
*end = '\0'; /* strip ending quote or return */
|
||||||
@@ -559,7 +559,7 @@ static void parse_negotiate_header(request_rec *r, negotiation_state *neg)
|
|||||||
if (strcmp(tok, "trans") == 0 ||
|
if (strcmp(tok, "trans") == 0 ||
|
||||||
strcmp(tok, "vlist") == 0 ||
|
strcmp(tok, "vlist") == 0 ||
|
||||||
strcmp(tok, "guess-small") == 0 ||
|
strcmp(tok, "guess-small") == 0 ||
|
||||||
ap_isdigit(tok[0]) ||
|
apr_isdigit(tok[0]) ||
|
||||||
strcmp(tok, "*") == 0) {
|
strcmp(tok, "*") == 0) {
|
||||||
|
|
||||||
/* The user agent supports transparent negotiation */
|
/* The user agent supports transparent negotiation */
|
||||||
@@ -665,7 +665,7 @@ static enum header_state get_header_line(char *buffer, int len, apr_file_t *map)
|
|||||||
|
|
||||||
/* If blank, just return it --- this ends information on this variant */
|
/* If blank, just return it --- this ends information on this variant */
|
||||||
|
|
||||||
for (cp = buffer; (*cp && ap_isspace(*cp)); ++cp) {
|
for (cp = buffer; (*cp && apr_isspace(*cp)); ++cp) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -686,13 +686,13 @@ static enum header_state get_header_line(char *buffer, int len, apr_file_t *map)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (ap_isspace(c)) {
|
else if (apr_isspace(c)) {
|
||||||
/* Leading whitespace. POSSIBLE continuation line
|
/* Leading whitespace. POSSIBLE continuation line
|
||||||
* Also, possibly blank --- if so, we ungetc() the final newline
|
* Also, possibly blank --- if so, we ungetc() the final newline
|
||||||
* so that we will pick up the blank line the next time 'round.
|
* so that we will pick up the blank line the next time 'round.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
while (c != '\n' && ap_isspace(c)) {
|
while (c != '\n' && apr_isspace(c)) {
|
||||||
if(apr_getc(&c, map) != APR_SUCCESS)
|
if(apr_getc(&c, map) != APR_SUCCESS)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -761,7 +761,7 @@ static char *lcase_header_name_return_body(char *header, request_rec *r)
|
|||||||
char *cp = header;
|
char *cp = header;
|
||||||
|
|
||||||
for ( ; *cp && *cp != ':' ; ++cp) {
|
for ( ; *cp && *cp != ':' ; ++cp) {
|
||||||
*cp = ap_tolower(*cp);
|
*cp = apr_tolower(*cp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!*cp) {
|
if (!*cp) {
|
||||||
@@ -772,7 +772,7 @@ static char *lcase_header_name_return_body(char *header, request_rec *r)
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
++cp;
|
++cp;
|
||||||
} while (*cp && ap_isspace(*cp));
|
} while (*cp && apr_isspace(*cp));
|
||||||
|
|
||||||
if (!*cp) {
|
if (!*cp) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
@@ -2648,7 +2648,7 @@ static int handle_multi(request_rec *r)
|
|||||||
* some values in this request will be allocated in r->pool, and others in
|
* some values in this request will be allocated in r->pool, and others in
|
||||||
* sub_req->pool.
|
* sub_req->pool.
|
||||||
*/
|
*/
|
||||||
ap_pool_join(r->pool, sub_req->pool);
|
apr_pool_join(r->pool, sub_req->pool);
|
||||||
r->mtime = 0; /* reset etag info for subrequest */
|
r->mtime = 0; /* reset etag info for subrequest */
|
||||||
r->filename = sub_req->filename;
|
r->filename = sub_req->filename;
|
||||||
r->handler = sub_req->handler;
|
r->handler = sub_req->handler;
|
||||||
|
@@ -891,7 +891,7 @@ static const char *cmd_rewriterule_setflag(apr_pool_t *p, rewriterule_entry *cfg
|
|||||||
else if (strcasecmp(val, "seeother") == 0) {
|
else if (strcasecmp(val, "seeother") == 0) {
|
||||||
status = HTTP_SEE_OTHER;
|
status = HTTP_SEE_OTHER;
|
||||||
}
|
}
|
||||||
else if (ap_isdigit(*val)) {
|
else if (apr_isdigit(*val)) {
|
||||||
status = atoi(val);
|
status = atoi(val);
|
||||||
}
|
}
|
||||||
if (!ap_is_HTTP_REDIRECT(status)) {
|
if (!ap_is_HTTP_REDIRECT(status)) {
|
||||||
@@ -3064,7 +3064,7 @@ static char *rewrite_mapfunc_toupper(request_rec *r, char *key)
|
|||||||
|
|
||||||
for (cp = value = apr_pstrdup(r->pool, key); cp != NULL && *cp != '\0';
|
for (cp = value = apr_pstrdup(r->pool, key); cp != NULL && *cp != '\0';
|
||||||
cp++) {
|
cp++) {
|
||||||
*cp = ap_toupper(*cp);
|
*cp = apr_toupper(*cp);
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
@@ -3075,7 +3075,7 @@ static char *rewrite_mapfunc_tolower(request_rec *r, char *key)
|
|||||||
|
|
||||||
for (cp = value = apr_pstrdup(r->pool, key); cp != NULL && *cp != '\0';
|
for (cp = value = apr_pstrdup(r->pool, key); cp != NULL && *cp != '\0';
|
||||||
cp++) {
|
cp++) {
|
||||||
*cp = ap_tolower(*cp);
|
*cp = apr_tolower(*cp);
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
@@ -3300,7 +3300,7 @@ static void rewritelog(request_rec *r, int level, const char *text, ...)
|
|||||||
|
|
||||||
static char *current_logtime(request_rec *r)
|
static char *current_logtime(request_rec *r)
|
||||||
{
|
{
|
||||||
ap_exploded_time_t t;
|
apr_exploded_time_t t;
|
||||||
char tstr[80];
|
char tstr[80];
|
||||||
apr_size_t len;
|
apr_size_t len;
|
||||||
|
|
||||||
@@ -3535,7 +3535,7 @@ static char *lookup_variable(request_rec *r, char *var)
|
|||||||
{
|
{
|
||||||
const char *result;
|
const char *result;
|
||||||
char resultbuf[LONG_STRING_LEN];
|
char resultbuf[LONG_STRING_LEN];
|
||||||
ap_exploded_time_t tm;
|
apr_exploded_time_t tm;
|
||||||
request_rec *rsub;
|
request_rec *rsub;
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
struct passwd *pw;
|
struct passwd *pw;
|
||||||
@@ -3781,7 +3781,7 @@ static char *lookup_header(request_rec *r, const char *name)
|
|||||||
apr_table_entry_t *hdrs;
|
apr_table_entry_t *hdrs;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
hdrs_arr = ap_table_elts(r->headers_in);
|
hdrs_arr = apr_table_elts(r->headers_in);
|
||||||
hdrs = (apr_table_entry_t *)hdrs_arr->elts;
|
hdrs = (apr_table_entry_t *)hdrs_arr->elts;
|
||||||
for (i = 0; i < hdrs_arr->nelts; ++i) {
|
for (i = 0; i < hdrs_arr->nelts; ++i) {
|
||||||
if (hdrs[i].key == NULL) {
|
if (hdrs[i].key == NULL) {
|
||||||
|
@@ -197,15 +197,15 @@ typedef struct {
|
|||||||
|
|
||||||
static sp_reason spdist(const char *s, const char *t)
|
static sp_reason spdist(const char *s, const char *t)
|
||||||
{
|
{
|
||||||
for (; ap_tolower(*s) == ap_tolower(*t); t++, s++) {
|
for (; apr_tolower(*s) == apr_tolower(*t); t++, s++) {
|
||||||
if (*t == '\0') {
|
if (*t == '\0') {
|
||||||
return SP_MISCAPITALIZED; /* exact match (sans case) */
|
return SP_MISCAPITALIZED; /* exact match (sans case) */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (*s) {
|
if (*s) {
|
||||||
if (*t) {
|
if (*t) {
|
||||||
if (s[1] && t[1] && ap_tolower(*s) == ap_tolower(t[1])
|
if (s[1] && t[1] && apr_tolower(*s) == apr_tolower(t[1])
|
||||||
&& ap_tolower(*t) == ap_tolower(s[1])
|
&& apr_tolower(*t) == apr_tolower(s[1])
|
||||||
&& strcasecmp(s + 2, t + 2) == 0) {
|
&& strcasecmp(s + 2, t + 2) == 0) {
|
||||||
return SP_TRANSPOSITION; /* transposition */
|
return SP_TRANSPOSITION; /* transposition */
|
||||||
}
|
}
|
||||||
|
@@ -212,7 +212,7 @@ static const char *vhost_alias_set(cmd_parms *cmd, void *dummy, const char *map)
|
|||||||
++p;
|
++p;
|
||||||
}
|
}
|
||||||
/* digit N */
|
/* digit N */
|
||||||
if (ap_isdigit(*p)) {
|
if (apr_isdigit(*p)) {
|
||||||
++p;
|
++p;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -232,7 +232,7 @@ static const char *vhost_alias_set(cmd_parms *cmd, void *dummy, const char *map)
|
|||||||
++p;
|
++p;
|
||||||
}
|
}
|
||||||
/* digit M */
|
/* digit M */
|
||||||
if (ap_isdigit(*p)) {
|
if (apr_isdigit(*p)) {
|
||||||
++p;
|
++p;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -270,7 +270,7 @@ static const command_rec mva_commands[] =
|
|||||||
* This really wants to be a nested function
|
* This really wants to be a nested function
|
||||||
* but C is too feeble to support them.
|
* but C is too feeble to support them.
|
||||||
*/
|
*/
|
||||||
static ap_inline void vhost_alias_checkspace(request_rec *r, char *buf,
|
static apr_inline void vhost_alias_checkspace(request_rec *r, char *buf,
|
||||||
char **pdest, int size)
|
char **pdest, int size)
|
||||||
{
|
{
|
||||||
/* XXX: what if size > HUGE_STRING_LEN? */
|
/* XXX: what if size > HUGE_STRING_LEN? */
|
||||||
@@ -399,7 +399,7 @@ static void vhost_alias_interpolate(request_rec *r, const char *name,
|
|||||||
}
|
}
|
||||||
vhost_alias_checkspace(r, buf, &dest, end - start);
|
vhost_alias_checkspace(r, buf, &dest, end - start);
|
||||||
for (p = start; p < end; ++p) {
|
for (p = start; p < end; ++p) {
|
||||||
*dest++ = ap_tolower(*p);
|
*dest++ = apr_tolower(*p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*dest = '\0';
|
*dest = '\0';
|
||||||
|
@@ -267,7 +267,7 @@ static int scan_meta_file(request_rec *r, apr_file_t *f)
|
|||||||
}
|
}
|
||||||
|
|
||||||
*l++ = '\0';
|
*l++ = '\0';
|
||||||
while (*l && ap_isspace(*l))
|
while (*l && apr_isspace(*l))
|
||||||
++l;
|
++l;
|
||||||
|
|
||||||
if (!strcasecmp(w, "Content-type")) {
|
if (!strcasecmp(w, "Content-type")) {
|
||||||
@@ -275,7 +275,7 @@ static int scan_meta_file(request_rec *r, apr_file_t *f)
|
|||||||
/* Nuke trailing whitespace */
|
/* Nuke trailing whitespace */
|
||||||
|
|
||||||
char *endp = l + strlen(l) - 1;
|
char *endp = l + strlen(l) - 1;
|
||||||
while (endp > l && ap_isspace(*endp))
|
while (endp > l && apr_isspace(*endp))
|
||||||
*endp-- = '\0';
|
*endp-- = '\0';
|
||||||
|
|
||||||
tmp = apr_pstrdup(r->pool, l);
|
tmp = apr_pstrdup(r->pool, l);
|
||||||
@@ -290,7 +290,7 @@ static int scan_meta_file(request_rec *r, apr_file_t *f)
|
|||||||
apr_table_set(tmp_headers, w, l);
|
apr_table_set(tmp_headers, w, l);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
apr_overlap_tables(r->headers_out, tmp_headers, AP_OVERLAP_TABLES_SET);
|
apr_overlap_tables(r->headers_out, tmp_headers, APR_OVERLAP_TABLES_SET);
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -152,7 +152,7 @@ static void *merge_env_dir_configs(apr_pool_t *p, void *basev, void *addv)
|
|||||||
|
|
||||||
new_table = apr_copy_table(p, base->vars);
|
new_table = apr_copy_table(p, base->vars);
|
||||||
|
|
||||||
arr = ap_table_elts(add->vars);
|
arr = apr_table_elts(add->vars);
|
||||||
elts = (apr_table_entry_t *)arr->elts;
|
elts = (apr_table_entry_t *)arr->elts;
|
||||||
|
|
||||||
for (i = 0; i < arr->nelts; ++i) {
|
for (i = 0; i < arr->nelts; ++i) {
|
||||||
|
@@ -290,7 +290,7 @@ static char *check_code(apr_pool_t *p, const char *code, char **real_code)
|
|||||||
while (word[0]) {
|
while (word[0]) {
|
||||||
/* <num>
|
/* <num>
|
||||||
*/
|
*/
|
||||||
if (ap_isdigit(word[0])) {
|
if (apr_isdigit(word[0])) {
|
||||||
num = atoi(word);
|
num = atoi(word);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -487,8 +487,8 @@ static int add_expires(request_rec *r)
|
|||||||
apr_table_mergen(r->headers_out, "Cache-Control",
|
apr_table_mergen(r->headers_out, "Cache-Control",
|
||||||
apr_psprintf(r->pool, "max-age=%qd",
|
apr_psprintf(r->pool, "max-age=%qd",
|
||||||
(expires - r->request_time)
|
(expires - r->request_time)
|
||||||
/ AP_USEC_PER_SEC));
|
/ APR_USEC_PER_SEC));
|
||||||
timestr = apr_palloc(r->pool, AP_RFC822_DATE_LEN);
|
timestr = apr_palloc(r->pool, APR_RFC822_DATE_LEN);
|
||||||
apr_rfc822_date(timestr, expires);
|
apr_rfc822_date(timestr, expires);
|
||||||
apr_table_setn(r->headers_out, "Expires", timestr);
|
apr_table_setn(r->headers_out, "Expires", timestr);
|
||||||
return OK;
|
return OK;
|
||||||
|
@@ -728,7 +728,7 @@ static int magic_rsl_to_request(request_rec *r)
|
|||||||
frag = frag->next, cur_frag++) {
|
frag = frag->next, cur_frag++) {
|
||||||
/* loop through the characters in the fragment */
|
/* loop through the characters in the fragment */
|
||||||
for (cur_pos = 0; frag->str[cur_pos]; cur_pos++) {
|
for (cur_pos = 0; frag->str[cur_pos]; cur_pos++) {
|
||||||
if (ap_isspace(frag->str[cur_pos])) {
|
if (apr_isspace(frag->str[cur_pos])) {
|
||||||
/* process whitespace actions for each state */
|
/* process whitespace actions for each state */
|
||||||
if (state == rsl_leading_space) {
|
if (state == rsl_leading_space) {
|
||||||
/* eat whitespace in this state */
|
/* eat whitespace in this state */
|
||||||
@@ -933,7 +933,7 @@ static void tryit(request_rec *r, unsigned char *buf, int nb, int checkzmagic)
|
|||||||
magic_rsl_puts(r, MIME_BINARY_UNKNOWN);
|
magic_rsl_puts(r, MIME_BINARY_UNKNOWN);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define EATAB {while (ap_isspace((unsigned char) *l)) ++l;}
|
#define EATAB {while (apr_isspace((unsigned char) *l)) ++l;}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* apprentice - load configuration from the magic file r
|
* apprentice - load configuration from the magic file r
|
||||||
@@ -975,7 +975,7 @@ static int apprentice(server_rec *s, apr_pool_t *p)
|
|||||||
|
|
||||||
/* skip leading whitespace */
|
/* skip leading whitespace */
|
||||||
ws_offset = 0;
|
ws_offset = 0;
|
||||||
while (line[ws_offset] && ap_isspace(line[ws_offset])) {
|
while (line[ws_offset] && apr_isspace(line[ws_offset])) {
|
||||||
ws_offset++;
|
ws_offset++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1018,10 +1018,10 @@ static int apprentice(server_rec *s, apr_pool_t *p)
|
|||||||
ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, 0, s,
|
ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, 0, s,
|
||||||
MODNAME ": apprentice test");
|
MODNAME ": apprentice test");
|
||||||
for (m = conf->magic; m; m = m->next) {
|
for (m = conf->magic; m; m = m->next) {
|
||||||
if (ap_isprint((((unsigned long) m) >> 24) & 255) &&
|
if (apr_isprint((((unsigned long) m) >> 24) & 255) &&
|
||||||
ap_isprint((((unsigned long) m) >> 16) & 255) &&
|
apr_isprint((((unsigned long) m) >> 16) & 255) &&
|
||||||
ap_isprint((((unsigned long) m) >> 8) & 255) &&
|
apr_isprint((((unsigned long) m) >> 8) & 255) &&
|
||||||
ap_isprint(((unsigned long) m) & 255)) {
|
apr_isprint(((unsigned long) m) & 255)) {
|
||||||
ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, 0, s,
|
ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, 0, s,
|
||||||
MODNAME ": apprentice: POINTER CLOBBERED! "
|
MODNAME ": apprentice: POINTER CLOBBERED! "
|
||||||
"m=\"%c%c%c%c\" line=%d",
|
"m=\"%c%c%c%c\" line=%d",
|
||||||
@@ -1149,7 +1149,7 @@ static int parse(server_rec *serv, apr_pool_t *p, char *l, int lineno)
|
|||||||
s = l;
|
s = l;
|
||||||
if (*l == '+' || *l == '-')
|
if (*l == '+' || *l == '-')
|
||||||
l++;
|
l++;
|
||||||
if (ap_isdigit((unsigned char) *l)) {
|
if (apr_isdigit((unsigned char) *l)) {
|
||||||
m->in.offset = strtol(l, &t, 0);
|
m->in.offset = strtol(l, &t, 0);
|
||||||
if (*s == '-')
|
if (*s == '-')
|
||||||
m->in.offset = -m->in.offset;
|
m->in.offset = -m->in.offset;
|
||||||
@@ -1164,7 +1164,7 @@ static int parse(server_rec *serv, apr_pool_t *p, char *l, int lineno)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
while (ap_isdigit((unsigned char) *l))
|
while (apr_isdigit((unsigned char) *l))
|
||||||
++l;
|
++l;
|
||||||
EATAB;
|
EATAB;
|
||||||
|
|
||||||
@@ -1262,7 +1262,7 @@ static int parse(server_rec *serv, apr_pool_t *p, char *l, int lineno)
|
|||||||
}
|
}
|
||||||
/* FALL THROUGH */
|
/* FALL THROUGH */
|
||||||
default:
|
default:
|
||||||
if (*l == 'x' && ap_isspace((unsigned char) l[1])) {
|
if (*l == 'x' && apr_isspace((unsigned char) l[1])) {
|
||||||
m->reln = *l;
|
m->reln = *l;
|
||||||
++l;
|
++l;
|
||||||
goto GetDesc; /* Bill The Cat */
|
goto GetDesc; /* Bill The Cat */
|
||||||
@@ -1334,7 +1334,7 @@ static char *getstr(server_rec *serv, register char *s, register char *p,
|
|||||||
register int val;
|
register int val;
|
||||||
|
|
||||||
while ((c = *s++) != '\0') {
|
while ((c = *s++) != '\0') {
|
||||||
if (ap_isspace((unsigned char) c))
|
if (apr_isspace((unsigned char) c))
|
||||||
break;
|
break;
|
||||||
if (p >= pmax) {
|
if (p >= pmax) {
|
||||||
ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, 0, serv,
|
ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, 0, serv,
|
||||||
@@ -1437,7 +1437,7 @@ static char *getstr(server_rec *serv, register char *s, register char *p,
|
|||||||
/* Single hex char to int; -1 if not a hex char. */
|
/* Single hex char to int; -1 if not a hex char. */
|
||||||
static int hextoint(int c)
|
static int hextoint(int c)
|
||||||
{
|
{
|
||||||
if (ap_isdigit((unsigned char) c))
|
if (apr_isdigit((unsigned char) c))
|
||||||
return c - '0';
|
return c - '0';
|
||||||
if ((c >= 'a') && (c <= 'f'))
|
if ((c >= 'a') && (c <= 'f'))
|
||||||
return c + 10 - 'a';
|
return c + 10 - 'a';
|
||||||
@@ -1570,10 +1570,10 @@ static int match(request_rec *r, unsigned char *s, int nbytes)
|
|||||||
|
|
||||||
#if MIME_MAGIC_DEBUG
|
#if MIME_MAGIC_DEBUG
|
||||||
for (m = conf->magic; m; m = m->next) {
|
for (m = conf->magic; m; m = m->next) {
|
||||||
if (ap_isprint((((unsigned long) m) >> 24) & 255) &&
|
if (apr_isprint((((unsigned long) m) >> 24) & 255) &&
|
||||||
ap_isprint((((unsigned long) m) >> 16) & 255) &&
|
apr_isprint((((unsigned long) m) >> 16) & 255) &&
|
||||||
ap_isprint((((unsigned long) m) >> 8) & 255) &&
|
apr_isprint((((unsigned long) m) >> 8) & 255) &&
|
||||||
ap_isprint(((unsigned long) m) & 255)) {
|
apr_isprint(((unsigned long) m) & 255)) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, 0, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, 0, r,
|
||||||
MODNAME ": match: POINTER CLOBBERED! "
|
MODNAME ": match: POINTER CLOBBERED! "
|
||||||
"m=\"%c%c%c%c\"",
|
"m=\"%c%c%c%c\"",
|
||||||
@@ -2008,15 +2008,15 @@ static int ascmagic(request_rec *r, unsigned char *buf, int nbytes)
|
|||||||
if (*buf == '.') {
|
if (*buf == '.') {
|
||||||
unsigned char *tp = buf + 1;
|
unsigned char *tp = buf + 1;
|
||||||
|
|
||||||
while (ap_isspace(*tp))
|
while (apr_isspace(*tp))
|
||||||
++tp; /* skip leading whitespace */
|
++tp; /* skip leading whitespace */
|
||||||
if ((ap_isalnum(*tp) || *tp == '\\') &&
|
if ((apr_isalnum(*tp) || *tp == '\\') &&
|
||||||
(ap_isalnum(*(tp + 1)) || *tp == '"')) {
|
(apr_isalnum(*(tp + 1)) || *tp == '"')) {
|
||||||
magic_rsl_puts(r, "application/x-troff");
|
magic_rsl_puts(r, "application/x-troff");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((*buf == 'c' || *buf == 'C') && ap_isspace(*(buf + 1))) {
|
if ((*buf == 'c' || *buf == 'C') && apr_isspace(*(buf + 1))) {
|
||||||
/* Fortran */
|
/* Fortran */
|
||||||
magic_rsl_puts(r, "text/plain");
|
magic_rsl_puts(r, "text/plain");
|
||||||
return 1;
|
return 1;
|
||||||
@@ -2299,7 +2299,7 @@ static long from_oct(int digs, char *where)
|
|||||||
{
|
{
|
||||||
register long value;
|
register long value;
|
||||||
|
|
||||||
while (ap_isspace(*where)) { /* Skip spaces */
|
while (apr_isspace(*where)) { /* Skip spaces */
|
||||||
where++;
|
where++;
|
||||||
if (--digs <= 0)
|
if (--digs <= 0)
|
||||||
return -1; /* All blank field */
|
return -1; /* All blank field */
|
||||||
@@ -2310,7 +2310,7 @@ static long from_oct(int digs, char *where)
|
|||||||
--digs;
|
--digs;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (digs > 0 && *where && !ap_isspace(*where))
|
if (digs > 0 && *where && !apr_isspace(*where))
|
||||||
return -1; /* Ended on non-space/nul */
|
return -1; /* Ended on non-space/nul */
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
@@ -2339,10 +2339,10 @@ static int revision_suffix(request_rec *r)
|
|||||||
|
|
||||||
/* check for recognized revision suffix */
|
/* check for recognized revision suffix */
|
||||||
suffix_pos = strlen(r->filename) - 1;
|
suffix_pos = strlen(r->filename) - 1;
|
||||||
if (!ap_isdigit(r->filename[suffix_pos])) {
|
if (!apr_isdigit(r->filename[suffix_pos])) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
while (suffix_pos >= 0 && ap_isdigit(r->filename[suffix_pos]))
|
while (suffix_pos >= 0 && apr_isdigit(r->filename[suffix_pos]))
|
||||||
suffix_pos--;
|
suffix_pos--;
|
||||||
if (suffix_pos < 0 || r->filename[suffix_pos] != '@') {
|
if (suffix_pos < 0 || r->filename[suffix_pos] != '@') {
|
||||||
return 0;
|
return 0;
|
||||||
@@ -2409,10 +2409,10 @@ static void magic_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, serve
|
|||||||
ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, 0, s,
|
ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, 0, s,
|
||||||
MODNAME ": magic_init 1 test");
|
MODNAME ": magic_init 1 test");
|
||||||
for (m = conf->magic; m; m = m->next) {
|
for (m = conf->magic; m; m = m->next) {
|
||||||
if (ap_isprint((((unsigned long) m) >> 24) & 255) &&
|
if (apr_isprint((((unsigned long) m) >> 24) & 255) &&
|
||||||
ap_isprint((((unsigned long) m) >> 16) & 255) &&
|
apr_isprint((((unsigned long) m) >> 16) & 255) &&
|
||||||
ap_isprint((((unsigned long) m) >> 8) & 255) &&
|
apr_isprint((((unsigned long) m) >> 8) & 255) &&
|
||||||
ap_isprint(((unsigned long) m) & 255)) {
|
apr_isprint(((unsigned long) m) & 255)) {
|
||||||
ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, 0, s,
|
ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, 0, s,
|
||||||
MODNAME ": magic_init 1: POINTER CLOBBERED! "
|
MODNAME ": magic_init 1: POINTER CLOBBERED! "
|
||||||
"m=\"%c%c%c%c\" line=%d",
|
"m=\"%c%c%c%c\" line=%d",
|
||||||
|
@@ -435,7 +435,7 @@ static int match_headers(request_rec *r)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!ap_regexec(b->preg, val, 0, NULL, 0)) {
|
if (!ap_regexec(b->preg, val, 0, NULL, 0)) {
|
||||||
apr_array_header_t *arr = ap_table_elts(b->features);
|
apr_array_header_t *arr = apr_table_elts(b->features);
|
||||||
elts = (apr_table_entry_t *) arr->elts;
|
elts = (apr_table_entry_t *) arr->elts;
|
||||||
|
|
||||||
for (j = 0; j < arr->nelts; ++j) {
|
for (j = 0; j < arr->nelts; ++j) {
|
||||||
|
@@ -244,7 +244,7 @@ static void unique_id_global_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *p
|
|||||||
* But protecting against it is relatively cheap. We just sleep into the
|
* But protecting against it is relatively cheap. We just sleep into the
|
||||||
* next second.
|
* next second.
|
||||||
*/
|
*/
|
||||||
pause = (apr_interval_time_t)(1000000 - (apr_now() % AP_USEC_PER_SEC));
|
pause = (apr_interval_time_t)(1000000 - (apr_now() % APR_USEC_PER_SEC));
|
||||||
apr_sleep(pause);
|
apr_sleep(pause);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -287,7 +287,7 @@ static void unique_id_child_init(apr_pool_t *p, server_rec *s)
|
|||||||
/* Some systems have very low variance on the low end of their system
|
/* Some systems have very low variance on the low end of their system
|
||||||
* counter, defend against that.
|
* counter, defend against that.
|
||||||
*/
|
*/
|
||||||
cur_unique_id.counter = tv % AP_USEC_PER_SEC / 10;
|
cur_unique_id.counter = tv % APR_USEC_PER_SEC / 10;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We must always use network ordering for these bytes, so that
|
* We must always use network ordering for these bytes, so that
|
||||||
|
@@ -140,15 +140,15 @@ static void make_cookie(request_rec *r)
|
|||||||
apr_snprintf(cookiebuf, sizeof(cookiebuf), "%s.%qd", rname, apr_now());
|
apr_snprintf(cookiebuf, sizeof(cookiebuf), "%s.%qd", rname, apr_now());
|
||||||
|
|
||||||
if (cls->expires) {
|
if (cls->expires) {
|
||||||
ap_exploded_time_t tms;
|
apr_exploded_time_t tms;
|
||||||
|
|
||||||
apr_explode_gmt(&tms, r->request_time + cls->expires * AP_USEC_PER_SEC);
|
apr_explode_gmt(&tms, r->request_time + cls->expires * APR_USEC_PER_SEC);
|
||||||
|
|
||||||
/* Cookie with date; as strftime '%a, %d-%h-%y %H:%M:%S GMT' */
|
/* Cookie with date; as strftime '%a, %d-%h-%y %H:%M:%S GMT' */
|
||||||
new_cookie = apr_psprintf(r->pool,
|
new_cookie = apr_psprintf(r->pool,
|
||||||
"%s=%s; path=/; expires=%s, %.2d-%s-%.2d %.2d:%.2d:%.2d GMT",
|
"%s=%s; path=/; expires=%s, %.2d-%s-%.2d %.2d:%.2d:%.2d GMT",
|
||||||
dcfg->cookie_name, cookiebuf, ap_day_snames[tms.tm_wday],
|
dcfg->cookie_name, cookiebuf, apr_day_snames[tms.tm_wday],
|
||||||
tms.tm_mday, ap_month_snames[tms.tm_mon],
|
tms.tm_mday, apr_month_snames[tms.tm_mon],
|
||||||
tms.tm_year % 100,
|
tms.tm_year % 100,
|
||||||
tms.tm_hour, tms.tm_min, tms.tm_sec);
|
tms.tm_hour, tms.tm_min, tms.tm_sec);
|
||||||
}
|
}
|
||||||
@@ -229,7 +229,7 @@ static const char *set_cookie_exp(cmd_parms *parms, void *dummy, const char *arg
|
|||||||
char *word;
|
char *word;
|
||||||
|
|
||||||
/* The simple case first - all numbers (we assume) */
|
/* The simple case first - all numbers (we assume) */
|
||||||
if (ap_isdigit(arg[0]) && ap_isdigit(arg[strlen(arg) - 1])) {
|
if (apr_isdigit(arg[0]) && apr_isdigit(arg[strlen(arg) - 1])) {
|
||||||
cls->expires = atol(arg);
|
cls->expires = atol(arg);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -248,7 +248,7 @@ static const char *set_cookie_exp(cmd_parms *parms, void *dummy, const char *arg
|
|||||||
/* {<num> <type>}* */
|
/* {<num> <type>}* */
|
||||||
while (word[0]) {
|
while (word[0]) {
|
||||||
/* <num> */
|
/* <num> */
|
||||||
if (ap_isdigit(word[0]))
|
if (apr_isdigit(word[0]))
|
||||||
num = atoi(word);
|
num = atoi(word);
|
||||||
else
|
else
|
||||||
return "bad expires code, numeric value expected.";
|
return "bad expires code, numeric value expected.";
|
||||||
|
@@ -609,7 +609,7 @@ static const char *
|
|||||||
ap_get_module_config(s->module_config, &proxy_module);
|
ap_get_module_config(s->module_config, &proxy_module);
|
||||||
int *New;
|
int *New;
|
||||||
|
|
||||||
if (!ap_isdigit(arg[0]))
|
if (!apr_isdigit(arg[0]))
|
||||||
return "AllowCONNECT: port number must be numeric";
|
return "AllowCONNECT: port number must be numeric";
|
||||||
|
|
||||||
New = apr_push_array(conf->allowed_connect_ports);
|
New = apr_push_array(conf->allowed_connect_ports);
|
||||||
|
@@ -144,7 +144,7 @@ int ap_proxy_connect_handler(request_rec *r, ap_cache_el *c, char *url,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* check if ProxyBlock directive on this host */
|
/* check if ProxyBlock directive on this host */
|
||||||
destaddr.s_addr = ap_inet_addr(host);
|
destaddr.s_addr = apr_inet_addr(host);
|
||||||
for (i = 0; i < conf->noproxies->nelts; i++) {
|
for (i = 0; i < conf->noproxies->nelts; i++) {
|
||||||
if ((npent[i].name != NULL && strstr(host, npent[i].name) != NULL)
|
if ((npent[i].name != NULL && strstr(host, npent[i].name) != NULL)
|
||||||
|| destaddr.s_addr == npent[i].addr.s_addr || npent[i].name[0] == '*')
|
|| destaddr.s_addr == npent[i].addr.s_addr || npent[i].name[0] == '*')
|
||||||
|
@@ -87,7 +87,7 @@ static int decodeenc(char *x)
|
|||||||
for (i = 0, j = 0; x[i] != '\0'; i++, j++) {
|
for (i = 0, j = 0; x[i] != '\0'; i++, j++) {
|
||||||
/* decode it if not already done */
|
/* decode it if not already done */
|
||||||
ch = x[i];
|
ch = x[i];
|
||||||
if (ch == '%' && ap_isxdigit(x[i + 1]) && ap_isxdigit(x[i + 2])) {
|
if (ch == '%' && apr_isxdigit(x[i + 1]) && apr_isxdigit(x[i + 2])) {
|
||||||
ch = ap_proxy_hex2c(&x[i + 1]);
|
ch = ap_proxy_hex2c(&x[i + 1]);
|
||||||
i += 2;
|
i += 2;
|
||||||
}
|
}
|
||||||
@@ -107,7 +107,7 @@ static int ftp_check_string(const char *x)
|
|||||||
|
|
||||||
for (i = 0; x[i] != '\0'; i++) {
|
for (i = 0; x[i] != '\0'; i++) {
|
||||||
ch = x[i];
|
ch = x[i];
|
||||||
if (ch == '%' && ap_isxdigit(x[i + 1]) && ap_isxdigit(x[i + 2])) {
|
if (ch == '%' && apr_isxdigit(x[i + 1]) && apr_isxdigit(x[i + 2])) {
|
||||||
ch = ap_proxy_hex2c(&x[i + 1]);
|
ch = ap_proxy_hex2c(&x[i + 1]);
|
||||||
i += 2;
|
i += 2;
|
||||||
}
|
}
|
||||||
@@ -207,8 +207,8 @@ static int ftp_getrc(BUFF *f)
|
|||||||
if (len == -1)
|
if (len == -1)
|
||||||
return -1;
|
return -1;
|
||||||
/* check format */
|
/* check format */
|
||||||
if (len < 5 || !ap_isdigit(linebuff[0]) || !ap_isdigit(linebuff[1]) ||
|
if (len < 5 || !apr_isdigit(linebuff[0]) || !apr_isdigit(linebuff[1]) ||
|
||||||
!ap_isdigit(linebuff[2]) || (linebuff[3] != ' ' && linebuff[3] != '-'))
|
!apr_isdigit(linebuff[2]) || (linebuff[3] != ' ' && linebuff[3] != '-'))
|
||||||
status = 0;
|
status = 0;
|
||||||
else
|
else
|
||||||
status = 100 * linebuff[0] + 10 * linebuff[1] + linebuff[2] - 111 * '0';
|
status = 100 * linebuff[0] + 10 * linebuff[1] + linebuff[2] - 111 * '0';
|
||||||
@@ -248,8 +248,8 @@ static int ftp_getrc_msg(BUFF *f, char *msgbuf, int msglen)
|
|||||||
len = ap_bgets(linebuff, sizeof linebuff, f);
|
len = ap_bgets(linebuff, sizeof linebuff, f);
|
||||||
if (len == -1)
|
if (len == -1)
|
||||||
return -1;
|
return -1;
|
||||||
if (len < 5 || !ap_isdigit(linebuff[0]) || !ap_isdigit(linebuff[1]) ||
|
if (len < 5 || !apr_isdigit(linebuff[0]) || !apr_isdigit(linebuff[1]) ||
|
||||||
!ap_isdigit(linebuff[2]) || (linebuff[3] != ' ' && linebuff[3] != '-'))
|
!apr_isdigit(linebuff[2]) || (linebuff[3] != ' ' && linebuff[3] != '-'))
|
||||||
status = 0;
|
status = 0;
|
||||||
else
|
else
|
||||||
status = 100 * linebuff[0] + 10 * linebuff[1] + linebuff[2] - 111 * '0';
|
status = 100 * linebuff[0] + 10 * linebuff[1] + linebuff[2] - 111 * '0';
|
||||||
@@ -359,8 +359,8 @@ static long int send_dir(BUFF *f, request_rec *r, ap_cache_el *c, char *cwd)
|
|||||||
apr_cpystrn(buf, buf2, sizeof(buf));
|
apr_cpystrn(buf, buf2, sizeof(buf));
|
||||||
n = strlen(buf);
|
n = strlen(buf);
|
||||||
}
|
}
|
||||||
else if (buf[0] == 'd' || buf[0] == '-' || buf[0] == 'l' || ap_isdigit(buf[0])) {
|
else if (buf[0] == 'd' || buf[0] == '-' || buf[0] == 'l' || apr_isdigit(buf[0])) {
|
||||||
if (ap_isdigit(buf[0])) { /* handle DOS dir */
|
if (apr_isdigit(buf[0])) { /* handle DOS dir */
|
||||||
searchptr = strchr(buf, '<');
|
searchptr = strchr(buf, '<');
|
||||||
if (searchptr != NULL)
|
if (searchptr != NULL)
|
||||||
*searchptr = '[';
|
*searchptr = '[';
|
||||||
@@ -487,7 +487,7 @@ int ap_proxy_ftp_handler(request_rec *r, ap_cache_el *c, char *url)
|
|||||||
unsigned short pport;
|
unsigned short pport;
|
||||||
int pasvmode = 0;
|
int pasvmode = 0;
|
||||||
char pasv[64];
|
char pasv[64];
|
||||||
char *pstr, dates[AP_RFC822_DATE_LEN];
|
char *pstr, dates[APR_RFC822_DATE_LEN];
|
||||||
|
|
||||||
char *npaddr;
|
char *npaddr;
|
||||||
apr_uint32_t npport;
|
apr_uint32_t npport;
|
||||||
@@ -546,7 +546,7 @@ int ap_proxy_ftp_handler(request_rec *r, ap_cache_el *c, char *url)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* check if ProxyBlock directive on this host */
|
/* check if ProxyBlock directive on this host */
|
||||||
destaddr.s_addr = ap_inet_addr(host);
|
destaddr.s_addr = apr_inet_addr(host);
|
||||||
for (i = 0; i < conf->noproxies->nelts; i++) {
|
for (i = 0; i < conf->noproxies->nelts; i++) {
|
||||||
if ((npent[i].name != NULL && strstr(host, npent[i].name) != NULL)
|
if ((npent[i].name != NULL && strstr(host, npent[i].name) != NULL)
|
||||||
|| destaddr.s_addr == npent[i].addr.s_addr || npent[i].name[0] == '*')
|
|| destaddr.s_addr == npent[i].addr.s_addr || npent[i].name[0] == '*')
|
||||||
@@ -936,7 +936,7 @@ int ap_proxy_ftp_handler(request_rec *r, ap_cache_el *c, char *url)
|
|||||||
len = 0;
|
len = 0;
|
||||||
}
|
}
|
||||||
else if (i == 213) { /* Size command ok */
|
else if (i == 213) { /* Size command ok */
|
||||||
for (j = 0; j < sizeof resp && ap_isdigit(resp[j]); j++)
|
for (j = 0; j < sizeof resp && apr_isdigit(resp[j]); j++)
|
||||||
;
|
;
|
||||||
resp[j] = '\0';
|
resp[j] = '\0';
|
||||||
if (resp[0] != '\0')
|
if (resp[0] != '\0')
|
||||||
|
@@ -147,9 +147,9 @@ static void clear_connection(apr_pool_t *p, apr_table_t *headers)
|
|||||||
|
|
||||||
while (*next) {
|
while (*next) {
|
||||||
name = next;
|
name = next;
|
||||||
while (*next && !ap_isspace(*next) && (*next != ','))
|
while (*next && !apr_isspace(*next) && (*next != ','))
|
||||||
++next;
|
++next;
|
||||||
while (*next && (ap_isspace(*next) || (*next == ','))) {
|
while (*next && (apr_isspace(*next) || (*next == ','))) {
|
||||||
*next = '\0';
|
*next = '\0';
|
||||||
++next;
|
++next;
|
||||||
}
|
}
|
||||||
@@ -224,14 +224,14 @@ int ap_proxy_http_handler(request_rec *r, ap_cache_el *c, char *url,
|
|||||||
strp2 = strchr(desthost, ':');
|
strp2 = strchr(desthost, ':');
|
||||||
if (strp2 != NULL) {
|
if (strp2 != NULL) {
|
||||||
*(strp2++) = '\0';
|
*(strp2++) = '\0';
|
||||||
if (ap_isdigit(*strp2)) {
|
if (apr_isdigit(*strp2)) {
|
||||||
destport = atoi(strp2);
|
destport = atoi(strp2);
|
||||||
destportstr = strp2;
|
destportstr = strp2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check if ProxyBlock directive on this host */
|
/* check if ProxyBlock directive on this host */
|
||||||
destaddr.s_addr = ap_inet_addr(desthost);
|
destaddr.s_addr = apr_inet_addr(desthost);
|
||||||
for (i = 0; i < conf->noproxies->nelts; i++) {
|
for (i = 0; i < conf->noproxies->nelts; i++) {
|
||||||
if ((npent[i].name != NULL && strstr(desthost, npent[i].name) != NULL)
|
if ((npent[i].name != NULL && strstr(desthost, npent[i].name) != NULL)
|
||||||
|| destaddr.s_addr == npent[i].addr.s_addr || npent[i].name[0] == '*')
|
|| destaddr.s_addr == npent[i].addr.s_addr || npent[i].name[0] == '*')
|
||||||
@@ -304,7 +304,7 @@ int ap_proxy_http_handler(request_rec *r, ap_cache_el *c, char *url,
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
reqhdrs_arr = ap_table_elts(r->headers_in);
|
reqhdrs_arr = apr_table_elts(r->headers_in);
|
||||||
reqhdrs = (apr_table_entry_t *) reqhdrs_arr->elts;
|
reqhdrs = (apr_table_entry_t *) reqhdrs_arr->elts;
|
||||||
for (i = 0; i < reqhdrs_arr->nelts; i++) {
|
for (i = 0; i < reqhdrs_arr->nelts; i++) {
|
||||||
if (reqhdrs[i].key == NULL || reqhdrs[i].val == NULL
|
if (reqhdrs[i].key == NULL || reqhdrs[i].val == NULL
|
||||||
|
@@ -78,18 +78,18 @@ int ap_proxy_hex2c(const char *x)
|
|||||||
|
|
||||||
#ifndef CHARSET_EBCDIC
|
#ifndef CHARSET_EBCDIC
|
||||||
ch = x[0];
|
ch = x[0];
|
||||||
if (ap_isdigit(ch))
|
if (apr_isdigit(ch))
|
||||||
i = ch - '0';
|
i = ch - '0';
|
||||||
else if (ap_isupper(ch))
|
else if (apr_isupper(ch))
|
||||||
i = ch - ('A' - 10);
|
i = ch - ('A' - 10);
|
||||||
else
|
else
|
||||||
i = ch - ('a' - 10);
|
i = ch - ('a' - 10);
|
||||||
i <<= 4;
|
i <<= 4;
|
||||||
|
|
||||||
ch = x[1];
|
ch = x[1];
|
||||||
if (ap_isdigit(ch))
|
if (apr_isdigit(ch))
|
||||||
i += ch - '0';
|
i += ch - '0';
|
||||||
else if (ap_isupper(ch))
|
else if (apr_isupper(ch))
|
||||||
i += ch - ('A' - 10);
|
i += ch - ('A' - 10);
|
||||||
else
|
else
|
||||||
i += ch - ('a' - 10);
|
i += ch - ('a' - 10);
|
||||||
@@ -180,7 +180,7 @@ char *
|
|||||||
}
|
}
|
||||||
/* decode it if not already done */
|
/* decode it if not already done */
|
||||||
if (isenc && ch == '%') {
|
if (isenc && ch == '%') {
|
||||||
if (!ap_isxdigit(x[i + 1]) || !ap_isxdigit(x[i + 2]))
|
if (!apr_isxdigit(x[i + 1]) || !apr_isxdigit(x[i + 2]))
|
||||||
return NULL;
|
return NULL;
|
||||||
ch = ap_proxy_hex2c(&x[i + 1]);
|
ch = ap_proxy_hex2c(&x[i + 1]);
|
||||||
i += 2;
|
i += 2;
|
||||||
@@ -191,7 +191,7 @@ char *
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* recode it, if necessary */
|
/* recode it, if necessary */
|
||||||
if (!ap_isalnum(ch) && !strchr(allowed, ch)) {
|
if (!apr_isalnum(ch) && !strchr(allowed, ch)) {
|
||||||
ap_proxy_c2hex(ch, &y[j]);
|
ap_proxy_c2hex(ch, &y[j]);
|
||||||
j += 2;
|
j += 2;
|
||||||
}
|
}
|
||||||
@@ -262,7 +262,7 @@ char *
|
|||||||
*(strp++) = '\0';
|
*(strp++) = '\0';
|
||||||
|
|
||||||
for (i = 0; strp[i] != '\0'; i++)
|
for (i = 0; strp[i] != '\0'; i++)
|
||||||
if (!ap_isdigit(strp[i]))
|
if (!apr_isdigit(strp[i]))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* if (i == 0) the no port was given; keep default */
|
/* if (i == 0) the no port was given; keep default */
|
||||||
@@ -279,13 +279,13 @@ char *
|
|||||||
return "Missing host in URL";
|
return "Missing host in URL";
|
||||||
/* check hostname syntax */
|
/* check hostname syntax */
|
||||||
for (i = 0; host[i] != '\0'; i++)
|
for (i = 0; host[i] != '\0'; i++)
|
||||||
if (!ap_isdigit(host[i]) && host[i] != '.')
|
if (!apr_isdigit(host[i]) && host[i] != '.')
|
||||||
break;
|
break;
|
||||||
/* must be an IP address */
|
/* must be an IP address */
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
if (host[i] == '\0' && (inet_addr(host) == -1))
|
if (host[i] == '\0' && (inet_addr(host) == -1))
|
||||||
#else
|
#else
|
||||||
if (host[i] == '\0' && (ap_inet_addr(host) == -1 || inet_network(host) == -1))
|
if (host[i] == '\0' && (apr_inet_addr(host) == -1 || inet_network(host) == -1))
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
return "Bad IP address in URL";
|
return "Bad IP address in URL";
|
||||||
@@ -346,7 +346,7 @@ const char *
|
|||||||
&min, &sec, &year) != 7)
|
&min, &sec, &year) != 7)
|
||||||
return x;
|
return x;
|
||||||
for (wk = 0; wk < 7; wk++)
|
for (wk = 0; wk < 7; wk++)
|
||||||
if (strcmp(week, ap_day_snames[wk]) == 0)
|
if (strcmp(week, apr_day_snames[wk]) == 0)
|
||||||
break;
|
break;
|
||||||
if (wk == 7)
|
if (wk == 7)
|
||||||
return x;
|
return x;
|
||||||
@@ -354,14 +354,14 @@ const char *
|
|||||||
|
|
||||||
/* check date */
|
/* check date */
|
||||||
for (mon = 0; mon < 12; mon++)
|
for (mon = 0; mon < 12; mon++)
|
||||||
if (strcmp(month, ap_month_snames[mon]) == 0)
|
if (strcmp(month, apr_month_snames[mon]) == 0)
|
||||||
break;
|
break;
|
||||||
if (mon == 12)
|
if (mon == 12)
|
||||||
return x;
|
return x;
|
||||||
|
|
||||||
q = apr_palloc(p, 30);
|
q = apr_palloc(p, 30);
|
||||||
apr_snprintf(q, 30, "%s, %.2d %s %d %.2d:%.2d:%.2d GMT", ap_day_snames[wk], mday,
|
apr_snprintf(q, 30, "%s, %.2d %s %d %.2d:%.2d:%.2d GMT", apr_day_snames[wk], mday,
|
||||||
ap_month_snames[mon], year, hour, min, sec);
|
apr_month_snames[mon], year, hour, min, sec);
|
||||||
return q;
|
return q;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -469,11 +469,11 @@ apr_table_t *ap_proxy_read_headers(request_rec *r, char *buffer, int size, BUFF
|
|||||||
/* XXX: RFC2068 defines only SP and HT as whitespace, this test is
|
/* XXX: RFC2068 defines only SP and HT as whitespace, this test is
|
||||||
* wrong... and so are many others probably.
|
* wrong... and so are many others probably.
|
||||||
*/
|
*/
|
||||||
while (ap_isspace(*value))
|
while (apr_isspace(*value))
|
||||||
++value; /* Skip to start of value */
|
++value; /* Skip to start of value */
|
||||||
|
|
||||||
/* should strip trailing whitespace as well */
|
/* should strip trailing whitespace as well */
|
||||||
for (end = &value[strlen(value)-1]; end > value && ap_isspace(*end); --end)
|
for (end = &value[strlen(value)-1]; end > value && apr_isspace(*end); --end)
|
||||||
*end = '\0';
|
*end = '\0';
|
||||||
|
|
||||||
apr_table_add(resp_hdrs, buffer, value);
|
apr_table_add(resp_hdrs, buffer, value);
|
||||||
@@ -607,11 +607,11 @@ void ap_proxy_send_headers(request_rec *r, const char *respline, apr_table_t *t)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
BUFF *fp = r->connection->client;
|
BUFF *fp = r->connection->client;
|
||||||
apr_table_entry_t *elts = (apr_table_entry_t *) ap_table_elts(t)->elts;
|
apr_table_entry_t *elts = (apr_table_entry_t *) apr_table_elts(t)->elts;
|
||||||
|
|
||||||
ap_bvputs(fp, respline, CRLF, NULL);
|
ap_bvputs(fp, respline, CRLF, NULL);
|
||||||
|
|
||||||
for (i = 0; i < ap_table_elts(t)->nelts; ++i) {
|
for (i = 0; i < apr_table_elts(t)->nelts; ++i) {
|
||||||
if (elts[i].key != NULL) {
|
if (elts[i].key != NULL) {
|
||||||
ap_bvputs(fp, elts[i].key, ": ", elts[i].val, CRLF, NULL);
|
ap_bvputs(fp, elts[i].key, ": ", elts[i].val, CRLF, NULL);
|
||||||
apr_table_addn(r->headers_out, elts[i].key, elts[i].val);
|
apr_table_addn(r->headers_out, elts[i].key, elts[i].val);
|
||||||
@@ -641,12 +641,12 @@ int ap_proxy_liststr(const char *list, const char *val)
|
|||||||
i = p - list;
|
i = p - list;
|
||||||
do
|
do
|
||||||
p++;
|
p++;
|
||||||
while (ap_isspace(*p));
|
while (apr_isspace(*p));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
i = strlen(list);
|
i = strlen(list);
|
||||||
|
|
||||||
while (i > 0 && ap_isspace(list[i - 1]))
|
while (i > 0 && apr_isspace(list[i - 1]))
|
||||||
i--;
|
i--;
|
||||||
if (i == len && strncasecmp(list, val, len) == 0)
|
if (i == len && strncasecmp(list, val, len) == 0)
|
||||||
return 1;
|
return 1;
|
||||||
@@ -667,9 +667,9 @@ int ap_proxy_hex2sec(const char *x)
|
|||||||
for (i = 0, j = 0; i < 8; i++) {
|
for (i = 0, j = 0; i < 8; i++) {
|
||||||
ch = x[i];
|
ch = x[i];
|
||||||
j <<= 4;
|
j <<= 4;
|
||||||
if (ap_isdigit(ch))
|
if (apr_isdigit(ch))
|
||||||
j |= ch - '0';
|
j |= ch - '0';
|
||||||
else if (ap_isupper(ch))
|
else if (apr_isupper(ch))
|
||||||
j |= ch - ('A' - 10);
|
j |= ch - ('A' - 10);
|
||||||
else
|
else
|
||||||
j |= ch - ('a' - 10);
|
j |= ch - ('a' - 10);
|
||||||
@@ -744,7 +744,7 @@ const char *ap_proxy_host2addr(const char *host, struct hostent *reqhp)
|
|||||||
static APACHE_TLS char *charpbuf[2];
|
static APACHE_TLS char *charpbuf[2];
|
||||||
|
|
||||||
for (i = 0; host[i] != '\0'; i++)
|
for (i = 0; host[i] != '\0'; i++)
|
||||||
if (!ap_isdigit(host[i]) && host[i] != '.')
|
if (!apr_isdigit(host[i]) && host[i] != '.')
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (host[i] != '\0') {
|
if (host[i] != '\0') {
|
||||||
@@ -753,7 +753,7 @@ const char *ap_proxy_host2addr(const char *host, struct hostent *reqhp)
|
|||||||
return "Host not found";
|
return "Host not found";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ipaddr = ap_inet_addr(host);
|
ipaddr = apr_inet_addr(host);
|
||||||
hp = gethostbyaddr((char *) &ipaddr, sizeof(u_long), AF_INET);
|
hp = gethostbyaddr((char *) &ipaddr, sizeof(u_long), AF_INET);
|
||||||
if (hp == NULL) {
|
if (hp == NULL) {
|
||||||
memset(&hpbuf, 0, sizeof(hpbuf));
|
memset(&hpbuf, 0, sizeof(hpbuf));
|
||||||
@@ -806,7 +806,7 @@ int ap_proxy_is_ipaddr(struct dirconn_entry *This, apr_pool_t *p)
|
|||||||
long bits;
|
long bits;
|
||||||
|
|
||||||
/* if the address is given with an explicit netmask, use that */
|
/* if the address is given with an explicit netmask, use that */
|
||||||
/* Due to a deficiency in ap_inet_addr(), it is impossible to parse */
|
/* Due to a deficiency in apr_inet_addr(), it is impossible to parse */
|
||||||
/* "partial" addresses (with less than 4 quads) correctly, i.e. */
|
/* "partial" addresses (with less than 4 quads) correctly, i.e. */
|
||||||
/* 192.168.123 is parsed as 192.168.0.123, which is not what I want. */
|
/* 192.168.123 is parsed as 192.168.0.123, which is not what I want. */
|
||||||
/* I therefore have to parse the IP address manually: */
|
/* I therefore have to parse the IP address manually: */
|
||||||
@@ -824,7 +824,7 @@ int ap_proxy_is_ipaddr(struct dirconn_entry *This, apr_pool_t *p)
|
|||||||
if (*addr == '/' && quads > 0) /* netmask starts here. */
|
if (*addr == '/' && quads > 0) /* netmask starts here. */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (!ap_isdigit(*addr))
|
if (!apr_isdigit(*addr))
|
||||||
return 0; /* no digit at start of quad */
|
return 0; /* no digit at start of quad */
|
||||||
|
|
||||||
ip_addr[quads] = strtol(addr, &tmp, 0);
|
ip_addr[quads] = strtol(addr, &tmp, 0);
|
||||||
@@ -846,7 +846,7 @@ int ap_proxy_is_ipaddr(struct dirconn_entry *This, apr_pool_t *p)
|
|||||||
for (This->addr.s_addr = 0, i = 0; i < quads; ++i)
|
for (This->addr.s_addr = 0, i = 0; i < quads; ++i)
|
||||||
This->addr.s_addr |= htonl(ip_addr[i] << (24 - 8 * i));
|
This->addr.s_addr |= htonl(ip_addr[i] << (24 - 8 * i));
|
||||||
|
|
||||||
if (addr[0] == '/' && ap_isdigit(addr[1])) { /* net mask follows: */
|
if (addr[0] == '/' && apr_isdigit(addr[1])) { /* net mask follows: */
|
||||||
char *tmp;
|
char *tmp;
|
||||||
|
|
||||||
++addr;
|
++addr;
|
||||||
@@ -1004,7 +1004,7 @@ int ap_proxy_is_domainname(struct dirconn_entry *This, apr_pool_t *p)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* rfc1035 says DNS names must consist of "[-a-zA-Z0-9]" and '.' */
|
/* rfc1035 says DNS names must consist of "[-a-zA-Z0-9]" and '.' */
|
||||||
for (i = 0; ap_isalnum(addr[i]) || addr[i] == '-' || addr[i] == '.'; ++i)
|
for (i = 0; apr_isalnum(addr[i]) || addr[i] == '-' || addr[i] == '.'; ++i)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
@@ -1059,7 +1059,7 @@ int ap_proxy_is_hostname(struct dirconn_entry *This, apr_pool_t *p)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* rfc1035 says DNS names must consist of "[-a-zA-Z0-9]" and '.' */
|
/* rfc1035 says DNS names must consist of "[-a-zA-Z0-9]" and '.' */
|
||||||
for (i = 0; ap_isalnum(addr[i]) || addr[i] == '-' || addr[i] == '.'; ++i);
|
for (i = 0; apr_isalnum(addr[i]) || addr[i] == '-' || addr[i] == '.'; ++i);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if (addr[i] == ':') {
|
if (addr[i] == ':') {
|
||||||
@@ -1132,7 +1132,7 @@ int ap_proxy_doconnect(apr_socket_t *sock, char *host, apr_uint32_t port, reques
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; host[i] != '\0'; i++)
|
for (i = 0; host[i] != '\0'; i++)
|
||||||
if (!ap_isdigit(host[i]) && host[i] != '.')
|
if (!apr_isdigit(host[i]) && host[i] != '.')
|
||||||
break;
|
break;
|
||||||
|
|
||||||
apr_set_remote_port(sock, port);
|
apr_set_remote_port(sock, port);
|
||||||
|
@@ -93,7 +93,7 @@ static void ap_pad(char *dest, size_t size, char ch)
|
|||||||
static void ap_str_toupper(char *str)
|
static void ap_str_toupper(char *str)
|
||||||
{
|
{
|
||||||
while (*str) {
|
while (*str) {
|
||||||
*str = ap_toupper(*str);
|
*str = apr_toupper(*str);
|
||||||
++str;
|
++str;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -71,7 +71,7 @@
|
|||||||
/* Compiler supports inline, so include the inlineable functions as
|
/* Compiler supports inline, so include the inlineable functions as
|
||||||
* part of the header
|
* part of the header
|
||||||
*/
|
*/
|
||||||
#define INLINE extern ap_inline
|
#define INLINE extern apr_inline
|
||||||
|
|
||||||
INLINE int ap_os_is_path_absolute(const char *file);
|
INLINE int ap_os_is_path_absolute(const char *file);
|
||||||
|
|
||||||
|
@@ -223,7 +223,7 @@ int ap_tpf_spawn_child(apr_pool_t *p, int (*func) (void *, child_info *),
|
|||||||
int fd_flags_out, fd_flags_in, fd_flags_err;
|
int fd_flags_out, fd_flags_in, fd_flags_err;
|
||||||
struct tpf_fork_input fork_input;
|
struct tpf_fork_input fork_input;
|
||||||
TPF_FORK_CHILD *cld = (TPF_FORK_CHILD *) data;
|
TPF_FORK_CHILD *cld = (TPF_FORK_CHILD *) data;
|
||||||
apr_array_header_t *env_arr = ap_table_elts ((array_header *) cld->subprocess_env);
|
apr_array_header_t *env_arr = apr_table_elts ((array_header *) cld->subprocess_env);
|
||||||
table_entry *elts = (table_entry *) env_arr->elts;
|
table_entry *elts = (table_entry *) env_arr->elts;
|
||||||
|
|
||||||
|
|
||||||
|
@@ -77,7 +77,7 @@
|
|||||||
/* Compiler supports inline, so include the inlineable functions as
|
/* Compiler supports inline, so include the inlineable functions as
|
||||||
* part of the header
|
* part of the header
|
||||||
*/
|
*/
|
||||||
#define INLINE extern ap_inline
|
#define INLINE extern apr_inline
|
||||||
#include "os-inline.c"
|
#include "os-inline.c"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -75,7 +75,7 @@
|
|||||||
/* Compiler supports inline, so include the inlineable functions as
|
/* Compiler supports inline, so include the inlineable functions as
|
||||||
* part of the header
|
* part of the header
|
||||||
*/
|
*/
|
||||||
#define INLINE extern ap_inline
|
#define INLINE extern apr_inline
|
||||||
|
|
||||||
INLINE int ap_os_is_path_absolute(const char *file);
|
INLINE int ap_os_is_path_absolute(const char *file);
|
||||||
|
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 766 B After Width: | Height: | Size: 1.1 KiB |
@@ -534,7 +534,7 @@ static char* ComposeHeaders(request_rec *r, char* data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
*value++ = '\0';
|
*value++ = '\0';
|
||||||
while (*value && ap_isspace(*value)) ++value;
|
while (*value && apr_isspace(*value)) ++value;
|
||||||
|
|
||||||
/* Check all the special-case headers. Similar to what
|
/* Check all the special-case headers. Similar to what
|
||||||
* ap_scan_script_header_err() does (see that function for
|
* ap_scan_script_header_err() does (see that function for
|
||||||
@@ -546,7 +546,7 @@ static char* ComposeHeaders(request_rec *r, char* data)
|
|||||||
/* Nuke trailing whitespace */
|
/* Nuke trailing whitespace */
|
||||||
char *tmp;
|
char *tmp;
|
||||||
char *endp = value + strlen(value) - 1;
|
char *endp = value + strlen(value) - 1;
|
||||||
while (endp > value && ap_isspace(*endp))
|
while (endp > value && apr_isspace(*endp))
|
||||||
*endp-- = '\0';
|
*endp-- = '\0';
|
||||||
|
|
||||||
tmp = apr_pstrdup (r->pool, value);
|
tmp = apr_pstrdup (r->pool, value);
|
||||||
|
@@ -193,7 +193,7 @@ void ap_lingering_close(conn_rec *c)
|
|||||||
if (rc != APR_SUCCESS || nbytes == 0) break;
|
if (rc != APR_SUCCESS || nbytes == 0) break;
|
||||||
|
|
||||||
/* how much time has elapsed? */
|
/* how much time has elapsed? */
|
||||||
timeout = (int)((apr_now() - start) / AP_USEC_PER_SEC);
|
timeout = (int)((apr_now() - start) / APR_USEC_PER_SEC);
|
||||||
if (timeout >= MAX_SECS_TO_LINGER) break;
|
if (timeout >= MAX_SECS_TO_LINGER) break;
|
||||||
|
|
||||||
/* figure out the new timeout */
|
/* figure out the new timeout */
|
||||||
|
@@ -101,16 +101,16 @@ int main(int argc, char *argv[])
|
|||||||
flags |= T_ESCAPE_SHELL_CMD;
|
flags |= T_ESCAPE_SHELL_CMD;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ap_isalnum(c) && !strchr("$-_.+!*'(),:@&=~", c)) {
|
if (!apr_isalnum(c) && !strchr("$-_.+!*'(),:@&=~", c)) {
|
||||||
flags |= T_ESCAPE_PATH_SEGMENT;
|
flags |= T_ESCAPE_PATH_SEGMENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ap_isalnum(c) && !strchr("$-_.+!*'(),:@&=/~", c)) {
|
if (!apr_isalnum(c) && !strchr("$-_.+!*'(),:@&=/~", c)) {
|
||||||
flags |= T_OS_ESCAPE_PATH;
|
flags |= T_OS_ESCAPE_PATH;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* these are the "tspecials" from RFC2068 */
|
/* these are the "tspecials" from RFC2068 */
|
||||||
if (ap_iscntrl(c) || strchr(" \t()<>@,;:\\/[]?={}", c)) {
|
if (apr_iscntrl(c) || strchr(" \t()<>@,;:\\/[]?={}", c)) {
|
||||||
flags |= T_HTTP_TOKEN_STOP;
|
flags |= T_HTTP_TOKEN_STOP;
|
||||||
}
|
}
|
||||||
printf("%u%c", flags, (c < 255) ? ',' : ' ');
|
printf("%u%c", flags, (c < 255) ? ',' : ' ');
|
||||||
|
12
server/log.c
12
server/log.c
@@ -372,9 +372,9 @@ static void log_error_core(const char *file, int line, int level,
|
|||||||
if (logf && ((level & APLOG_STARTUP) != APLOG_STARTUP)) {
|
if (logf && ((level & APLOG_STARTUP) != APLOG_STARTUP)) {
|
||||||
errstr[0] = '[';
|
errstr[0] = '[';
|
||||||
apr_ctime(errstr + 1, apr_now());
|
apr_ctime(errstr + 1, apr_now());
|
||||||
errstr[1 + AP_CTIME_LEN - 1] = ']';
|
errstr[1 + APR_CTIME_LEN - 1] = ']';
|
||||||
errstr[1 + AP_CTIME_LEN ] = ' ';
|
errstr[1 + APR_CTIME_LEN ] = ' ';
|
||||||
len = 1 + AP_CTIME_LEN + 1;
|
len = 1 + APR_CTIME_LEN + 1;
|
||||||
} else {
|
} else {
|
||||||
len = 0;
|
len = 0;
|
||||||
}
|
}
|
||||||
@@ -534,7 +534,7 @@ void ap_log_pid(apr_pool_t *p, const char *fname)
|
|||||||
|
|
||||||
API_EXPORT(void) ap_log_assert(const char *szExp, const char *szFile, int nLine)
|
API_EXPORT(void) ap_log_assert(const char *szExp, const char *szFile, int nLine)
|
||||||
{
|
{
|
||||||
char time_str[AP_CTIME_LEN];
|
char time_str[APR_CTIME_LEN];
|
||||||
|
|
||||||
apr_ctime(time_str, apr_now());
|
apr_ctime(time_str, apr_now());
|
||||||
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
|
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
|
||||||
@@ -552,7 +552,7 @@ API_EXPORT(void) ap_log_assert(const char *szExp, const char *szFile, int nLine)
|
|||||||
|
|
||||||
#ifdef HAVE_RELIABLE_PIPED_LOGS
|
#ifdef HAVE_RELIABLE_PIPED_LOGS
|
||||||
/* forward declaration */
|
/* forward declaration */
|
||||||
static void piped_log_maintenance(int reason, void *data, ap_wait_t status);
|
static void piped_log_maintenance(int reason, void *data, apr_wait_t status);
|
||||||
|
|
||||||
static int piped_log_spawn(piped_log *pl)
|
static int piped_log_spawn(piped_log *pl)
|
||||||
{
|
{
|
||||||
@@ -599,7 +599,7 @@ static int piped_log_spawn(piped_log *pl)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void piped_log_maintenance(int reason, void *data, ap_wait_t status)
|
static void piped_log_maintenance(int reason, void *data, apr_wait_t status)
|
||||||
{
|
{
|
||||||
piped_log *pl = data;
|
piped_log *pl = data;
|
||||||
apr_status_t stats;
|
apr_status_t stats;
|
||||||
|
@@ -323,21 +323,21 @@ int main(int argc, char *argv[])
|
|||||||
switch (c) {
|
switch (c) {
|
||||||
case 'c':
|
case 'c':
|
||||||
new = (char **)apr_push_array(ap_server_post_read_config);
|
new = (char **)apr_push_array(ap_server_post_read_config);
|
||||||
*new = apr_pstrdup(pcommands, ap_optarg);
|
*new = apr_pstrdup(pcommands, apr_optarg);
|
||||||
break;
|
break;
|
||||||
case 'C':
|
case 'C':
|
||||||
new = (char **)apr_push_array(ap_server_pre_read_config);
|
new = (char **)apr_push_array(ap_server_pre_read_config);
|
||||||
*new = apr_pstrdup(pcommands, ap_optarg);
|
*new = apr_pstrdup(pcommands, apr_optarg);
|
||||||
break;
|
break;
|
||||||
case 'd':
|
case 'd':
|
||||||
def_server_root = ap_optarg;
|
def_server_root = apr_optarg;
|
||||||
break;
|
break;
|
||||||
case 'D':
|
case 'D':
|
||||||
new = (char **)apr_push_array(ap_server_config_defines);
|
new = (char **)apr_push_array(ap_server_config_defines);
|
||||||
*new = apr_pstrdup(pcommands, ap_optarg);
|
*new = apr_pstrdup(pcommands, apr_optarg);
|
||||||
break;
|
break;
|
||||||
case 'f':
|
case 'f':
|
||||||
confname = ap_optarg;
|
confname = apr_optarg;
|
||||||
break;
|
break;
|
||||||
case 'v':
|
case 'v':
|
||||||
printf("Server version: %s\n", ap_get_server_version());
|
printf("Server version: %s\n", ap_get_server_version());
|
||||||
|
@@ -591,7 +591,7 @@ static void perform_idle_server_maintenance(void)
|
|||||||
static void server_main_loop(int remaining_threads_to_start)
|
static void server_main_loop(int remaining_threads_to_start)
|
||||||
{
|
{
|
||||||
int child_slot;
|
int child_slot;
|
||||||
ap_wait_t status;
|
apr_wait_t status;
|
||||||
apr_proc_t pid;
|
apr_proc_t pid;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@@ -903,7 +903,7 @@ static void perform_child_maintenance(void)
|
|||||||
static void server_main_loop(int remaining_children_to_start)
|
static void server_main_loop(int remaining_children_to_start)
|
||||||
{
|
{
|
||||||
int child_slot;
|
int child_slot;
|
||||||
ap_wait_t status;
|
apr_wait_t status;
|
||||||
apr_proc_t pid;
|
apr_proc_t pid;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@@ -1066,7 +1066,7 @@ static void perform_child_maintenance(void)
|
|||||||
static void server_main_loop(int remaining_children_to_start)
|
static void server_main_loop(int remaining_children_to_start)
|
||||||
{
|
{
|
||||||
int child_slot;
|
int child_slot;
|
||||||
ap_wait_t status;
|
apr_wait_t status;
|
||||||
apr_proc_t pid;
|
apr_proc_t pid;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@@ -624,7 +624,7 @@ static void perform_idle_server_maintenance(void)
|
|||||||
static void server_main_loop(int remaining_children_to_start)
|
static void server_main_loop(int remaining_children_to_start)
|
||||||
{
|
{
|
||||||
int child_slot;
|
int child_slot;
|
||||||
ap_wait_t status;
|
apr_wait_t status;
|
||||||
apr_proc_t pid;
|
apr_proc_t pid;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@@ -937,7 +937,7 @@ static void perform_idle_server_maintenance(void)
|
|||||||
static void server_main_loop(int remaining_children_to_start)
|
static void server_main_loop(int remaining_children_to_start)
|
||||||
{
|
{
|
||||||
int child_slot;
|
int child_slot;
|
||||||
ap_wait_t status;
|
apr_wait_t status;
|
||||||
apr_proc_t pid;
|
apr_proc_t pid;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@@ -153,7 +153,7 @@ void reinit_scoreboard(apr_pool_t *p)
|
|||||||
* anyway.
|
* anyway.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ap_inline void ap_sync_scoreboard_image(void)
|
apr_inline void ap_sync_scoreboard_image(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,7 +162,7 @@ API_EXPORT(int) ap_exists_scoreboard_image(void)
|
|||||||
return (ap_scoreboard_image ? 1 : 0);
|
return (ap_scoreboard_image ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ap_inline void put_scoreboard_info(int child_num, int thread_num,
|
static apr_inline void put_scoreboard_info(int child_num, int thread_num,
|
||||||
thread_score *new_score_rec)
|
thread_score *new_score_rec)
|
||||||
{
|
{
|
||||||
/* XXX - needs to be fixed to account for threads */
|
/* XXX - needs to be fixed to account for threads */
|
||||||
|
@@ -217,7 +217,7 @@ void ap_mpmt_pthread_force_reset_connection_status(long conn_id);
|
|||||||
|
|
||||||
API_EXPORT(void) reopen_scoreboard(apr_pool_t *p);
|
API_EXPORT(void) reopen_scoreboard(apr_pool_t *p);
|
||||||
|
|
||||||
ap_inline void ap_sync_scoreboard_image(void);
|
apr_inline void ap_sync_scoreboard_image(void);
|
||||||
void increment_counts(int child_num, int thread_num, request_rec *r);
|
void increment_counts(int child_num, int thread_num, request_rec *r);
|
||||||
void update_scoreboard_global(void);
|
void update_scoreboard_global(void);
|
||||||
API_EXPORT(int) find_child_by_pid(apr_proc_t *pid);
|
API_EXPORT(int) find_child_by_pid(apr_proc_t *pid);
|
||||||
|
@@ -1066,7 +1066,7 @@ static void perform_child_maintenance(void)
|
|||||||
static void server_main_loop(int remaining_children_to_start)
|
static void server_main_loop(int remaining_children_to_start)
|
||||||
{
|
{
|
||||||
int child_slot;
|
int child_slot;
|
||||||
ap_wait_t status;
|
apr_wait_t status;
|
||||||
apr_proc_t pid;
|
apr_proc_t pid;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@@ -373,7 +373,7 @@ static void reinit_scoreboard(apr_pool_t *p)
|
|||||||
* since when the parent is writing an entry, it's only noting SERVER_DEAD
|
* since when the parent is writing an entry, it's only noting SERVER_DEAD
|
||||||
* anyway.
|
* anyway.
|
||||||
*/
|
*/
|
||||||
ap_inline void ap_sync_scoreboard_image(void)
|
apr_inline void ap_sync_scoreboard_image(void)
|
||||||
{
|
{
|
||||||
#ifdef SCOREBOARD_FILE
|
#ifdef SCOREBOARD_FILE
|
||||||
lseek(scoreboard_fd, 0L, 0);
|
lseek(scoreboard_fd, 0L, 0);
|
||||||
@@ -392,7 +392,7 @@ API_EXPORT(int) ap_get_max_daemons(void)
|
|||||||
return ap_max_daemons_limit;
|
return ap_max_daemons_limit;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ap_inline void put_scoreboard_info(int child_num,
|
static apr_inline void put_scoreboard_info(int child_num,
|
||||||
short_score *new_score_rec)
|
short_score *new_score_rec)
|
||||||
{
|
{
|
||||||
#ifdef SCOREBOARD_FILE
|
#ifdef SCOREBOARD_FILE
|
||||||
@@ -534,7 +534,7 @@ static int find_child_by_pid(apr_proc_t *pid)
|
|||||||
Systems without a real waitpid sometimes lose a child's exit while waiting
|
Systems without a real waitpid sometimes lose a child's exit while waiting
|
||||||
for another. Search through the scoreboard for missing children.
|
for another. Search through the scoreboard for missing children.
|
||||||
*/
|
*/
|
||||||
int reap_children(ap_wait_t *status)
|
int reap_children(apr_wait_t *status)
|
||||||
{
|
{
|
||||||
int n, pid;
|
int n, pid;
|
||||||
|
|
||||||
@@ -544,7 +544,7 @@ int reap_children(ap_wait_t *status)
|
|||||||
kill((pid = ap_scoreboard_image->parent[n].pid), 0) == -1) {
|
kill((pid = ap_scoreboard_image->parent[n].pid), 0) == -1) {
|
||||||
ap_update_child_status(n, SERVER_DEAD, NULL);
|
ap_update_child_status(n, SERVER_DEAD, NULL);
|
||||||
/* just mark it as having a successful exit status */
|
/* just mark it as having a successful exit status */
|
||||||
bzero((char *) status, sizeof(ap_wait_t));
|
bzero((char *) status, sizeof(apr_wait_t));
|
||||||
return(pid);
|
return(pid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1372,7 +1372,7 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
|
|||||||
|
|
||||||
while (!restart_pending && !shutdown_pending) {
|
while (!restart_pending && !shutdown_pending) {
|
||||||
int child_slot;
|
int child_slot;
|
||||||
ap_wait_t status;
|
apr_wait_t status;
|
||||||
/* this is a memory leak, but I'll fix it later. */
|
/* this is a memory leak, but I'll fix it later. */
|
||||||
apr_proc_t pid;
|
apr_proc_t pid;
|
||||||
|
|
||||||
|
@@ -359,7 +359,7 @@ static int find_child_by_tid(int tid)
|
|||||||
#endif
|
#endif
|
||||||
static int wait_or_timeout_counter;
|
static int wait_or_timeout_counter;
|
||||||
|
|
||||||
static int wait_or_timeout(ap_wait_t *status)
|
static int wait_or_timeout(apr_wait_t *status)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
ULONG tid;
|
ULONG tid;
|
||||||
@@ -1247,7 +1247,7 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
|
|||||||
|
|
||||||
while (!restart_pending && !shutdown_pending) {
|
while (!restart_pending && !shutdown_pending) {
|
||||||
int child_slot;
|
int child_slot;
|
||||||
ap_wait_t status;
|
apr_wait_t status;
|
||||||
int tid = wait_or_timeout(&status);
|
int tid = wait_or_timeout(&status);
|
||||||
|
|
||||||
/* XXX: if it takes longer than 1 second for all our children
|
/* XXX: if it takes longer than 1 second for all our children
|
||||||
|
@@ -390,7 +390,7 @@ static void sock_disable_nagle(int s)
|
|||||||
*/
|
*/
|
||||||
static ap_listen_rec *head_listener;
|
static ap_listen_rec *head_listener;
|
||||||
|
|
||||||
static ap_inline ap_listen_rec *find_ready_listener(fd_set * main_fds)
|
static apr_inline ap_listen_rec *find_ready_listener(fd_set * main_fds)
|
||||||
{
|
{
|
||||||
ap_listen_rec *lr;
|
ap_listen_rec *lr;
|
||||||
SOCKET nsd;
|
SOCKET nsd;
|
||||||
@@ -908,7 +908,7 @@ static int create_acceptex_context(apr_pool_t *_pconf, ap_listen_rec *lr)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
static ap_inline apr_status_t reset_acceptex_context(PCOMP_CONTEXT context)
|
static apr_inline apr_status_t reset_acceptex_context(PCOMP_CONTEXT context)
|
||||||
{
|
{
|
||||||
DWORD BytesRead;
|
DWORD BytesRead;
|
||||||
SOCKET nsd;
|
SOCKET nsd;
|
||||||
@@ -1906,10 +1906,10 @@ void winnt_rewrite_args(process_rec *process)
|
|||||||
&opt, process->pool) == APR_SUCCESS) {
|
&opt, process->pool) == APR_SUCCESS) {
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
case 'n':
|
case 'n':
|
||||||
service_named = mpm_service_set_name(process->pool, ap_optarg);
|
service_named = mpm_service_set_name(process->pool, apr_optarg);
|
||||||
break;
|
break;
|
||||||
case 'k':
|
case 'k':
|
||||||
signal_arg = ap_optarg;
|
signal_arg = apr_optarg;
|
||||||
break;
|
break;
|
||||||
case 'i':
|
case 'i':
|
||||||
/* TODO: warn of depreciated syntax, "use -k install instead" */
|
/* TODO: warn of depreciated syntax, "use -k install instead" */
|
||||||
@@ -1923,9 +1923,9 @@ void winnt_rewrite_args(process_rec *process)
|
|||||||
optbuf[1] = (char) opt;
|
optbuf[1] = (char) opt;
|
||||||
new_arg = (char**) apr_push_array(mpm_new_argv);
|
new_arg = (char**) apr_push_array(mpm_new_argv);
|
||||||
*new_arg = apr_pstrdup(process->pool, optbuf);
|
*new_arg = apr_pstrdup(process->pool, optbuf);
|
||||||
if (ap_optarg) {
|
if (apr_optarg) {
|
||||||
new_arg = (char**) apr_push_array(mpm_new_argv);
|
new_arg = (char**) apr_push_array(mpm_new_argv);
|
||||||
*new_arg = ap_optarg;
|
*new_arg = apr_optarg;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1933,8 +1933,8 @@ void winnt_rewrite_args(process_rec *process)
|
|||||||
/* Set optreset and optind to allow apr_getopt to work correctly
|
/* Set optreset and optind to allow apr_getopt to work correctly
|
||||||
* when called from http_main.c
|
* when called from http_main.c
|
||||||
*/
|
*/
|
||||||
ap_optreset = 1;
|
apr_optreset = 1;
|
||||||
ap_optind = 1;
|
apr_optind = 1;
|
||||||
|
|
||||||
/* Track the number of args actually entered by the user */
|
/* Track the number of args actually entered by the user */
|
||||||
inst_argc = mpm_new_argv->nelts - fixed_args;
|
inst_argc = mpm_new_argv->nelts - fixed_args;
|
||||||
|
@@ -179,7 +179,7 @@ void ap_reclaim_child_processes(int terminate)
|
|||||||
#endif
|
#endif
|
||||||
static int wait_or_timeout_counter;
|
static int wait_or_timeout_counter;
|
||||||
|
|
||||||
void ap_wait_or_timeout(ap_wait_t *status, apr_proc_t *ret, apr_pool_t *p)
|
void ap_wait_or_timeout(apr_wait_t *status, apr_proc_t *ret, apr_pool_t *p)
|
||||||
{
|
{
|
||||||
apr_status_t rv;
|
apr_status_t rv;
|
||||||
|
|
||||||
@@ -208,7 +208,7 @@ void ap_wait_or_timeout(ap_wait_t *status, apr_proc_t *ret, apr_pool_t *p)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ap_process_child_status(apr_proc_t *pid, ap_wait_t status)
|
void ap_process_child_status(apr_proc_t *pid, apr_wait_t status)
|
||||||
{
|
{
|
||||||
/* Child died... if it died due to a fatal error,
|
/* Child died... if it died due to a fatal error,
|
||||||
* we should simply bail out.
|
* we should simply bail out.
|
||||||
|
@@ -137,7 +137,7 @@ API_EXPORT(char *) ap_field_noparam(apr_pool_t *p, const char *intype)
|
|||||||
return apr_pstrdup(p, intype);
|
return apr_pstrdup(p, intype);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
while ((semi > intype) && ap_isspace(semi[-1])) {
|
while ((semi > intype) && apr_isspace(semi[-1])) {
|
||||||
semi--;
|
semi--;
|
||||||
}
|
}
|
||||||
return apr_pstrndup(p, intype, semi - intype);
|
return apr_pstrndup(p, intype, semi - intype);
|
||||||
@@ -149,7 +149,7 @@ API_EXPORT(char *) ap_ht_time(apr_pool_t *p, apr_time_t t, const char *fmt, int
|
|||||||
apr_size_t retcode;
|
apr_size_t retcode;
|
||||||
char ts[MAX_STRING_LEN];
|
char ts[MAX_STRING_LEN];
|
||||||
char tf[MAX_STRING_LEN];
|
char tf[MAX_STRING_LEN];
|
||||||
ap_exploded_time_t xt;
|
apr_exploded_time_t xt;
|
||||||
|
|
||||||
if (gmt) {
|
if (gmt) {
|
||||||
const char *f;
|
const char *f;
|
||||||
@@ -251,7 +251,7 @@ API_EXPORT(int) ap_strcasecmp_match(const char *str, const char *exp)
|
|||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
else if ((exp[y] != '?') && (ap_tolower(str[x]) != ap_tolower(exp[y])))
|
else if ((exp[y] != '?') && (apr_tolower(str[x]) != apr_tolower(exp[y])))
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return (str[x] != '\0');
|
return (str[x] != '\0');
|
||||||
@@ -313,12 +313,12 @@ API_EXPORT(char *) ap_strcasestr(const char *s1, const char *s2)
|
|||||||
return((char *)s1);
|
return((char *)s1);
|
||||||
}
|
}
|
||||||
while(1) {
|
while(1) {
|
||||||
for ( ; (*s1 != '\0') && (ap_tolower(*s1) != ap_tolower(*s2)); s1++);
|
for ( ; (*s1 != '\0') && (apr_tolower(*s1) != apr_tolower(*s2)); s1++);
|
||||||
if (*s1 == '\0') return(NULL);
|
if (*s1 == '\0') return(NULL);
|
||||||
/* found first character of s2, see if the rest matches */
|
/* found first character of s2, see if the rest matches */
|
||||||
p1 = (char *)s1;
|
p1 = (char *)s1;
|
||||||
p2 = (char *)s2;
|
p2 = (char *)s2;
|
||||||
while (ap_tolower(*++p1) == ap_tolower(*++p2)) {
|
while (apr_tolower(*++p1) == apr_tolower(*++p2)) {
|
||||||
if (*p1 == '\0') {
|
if (*p1 == '\0') {
|
||||||
/* both strings ended together */
|
/* both strings ended together */
|
||||||
return((char *)s1);
|
return((char *)s1);
|
||||||
@@ -386,7 +386,7 @@ API_EXPORT(char *) ap_pregsub(apr_pool_t *p, const char *input, const char *sour
|
|||||||
while ((c = *src++) != '\0') {
|
while ((c = *src++) != '\0') {
|
||||||
if (c == '&')
|
if (c == '&')
|
||||||
no = 0;
|
no = 0;
|
||||||
else if (c == '$' && ap_isdigit(*src))
|
else if (c == '$' && apr_isdigit(*src))
|
||||||
no = *src++ - '0';
|
no = *src++ - '0';
|
||||||
else
|
else
|
||||||
no = 10;
|
no = 10;
|
||||||
@@ -411,7 +411,7 @@ API_EXPORT(char *) ap_pregsub(apr_pool_t *p, const char *input, const char *sour
|
|||||||
while ((c = *src++) != '\0') {
|
while ((c = *src++) != '\0') {
|
||||||
if (c == '&')
|
if (c == '&')
|
||||||
no = 0;
|
no = 0;
|
||||||
else if (c == '$' && ap_isdigit(*src))
|
else if (c == '$' && apr_isdigit(*src))
|
||||||
no = *src++ - '0';
|
no = *src++ - '0';
|
||||||
else
|
else
|
||||||
no = 10;
|
no = 10;
|
||||||
@@ -663,7 +663,7 @@ API_EXPORT(char *) ap_getword_white(apr_pool_t *atrans, const char **line)
|
|||||||
char *res;
|
char *res;
|
||||||
|
|
||||||
for (x = 0; (*line)[x]; x++) {
|
for (x = 0; (*line)[x]; x++) {
|
||||||
if (ap_isspace((*line)[x])) {
|
if (apr_isspace((*line)[x])) {
|
||||||
pos = x;
|
pos = x;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -678,7 +678,7 @@ API_EXPORT(char *) ap_getword_white(apr_pool_t *atrans, const char **line)
|
|||||||
res = apr_palloc(atrans, pos + 1);
|
res = apr_palloc(atrans, pos + 1);
|
||||||
apr_cpystrn(res, *line, pos + 1);
|
apr_cpystrn(res, *line, pos + 1);
|
||||||
|
|
||||||
while (ap_isspace((*line)[pos]))
|
while (apr_isspace((*line)[pos]))
|
||||||
++pos;
|
++pos;
|
||||||
|
|
||||||
*line += pos;
|
*line += pos;
|
||||||
@@ -748,7 +748,7 @@ API_EXPORT(char *) ap_getword_conf(apr_pool_t *p, const char **line)
|
|||||||
char *res;
|
char *res;
|
||||||
char quote;
|
char quote;
|
||||||
|
|
||||||
while (*str && ap_isspace(*str))
|
while (*str && apr_isspace(*str))
|
||||||
++str;
|
++str;
|
||||||
|
|
||||||
if (!*str) {
|
if (!*str) {
|
||||||
@@ -771,13 +771,13 @@ API_EXPORT(char *) ap_getword_conf(apr_pool_t *p, const char **line)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
strend = str;
|
strend = str;
|
||||||
while (*strend && !ap_isspace(*strend))
|
while (*strend && !apr_isspace(*strend))
|
||||||
++strend;
|
++strend;
|
||||||
|
|
||||||
res = substring_conf(p, str, strend - str, 0);
|
res = substring_conf(p, str, strend - str, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (*strend && ap_isspace(*strend))
|
while (*strend && apr_isspace(*strend))
|
||||||
++strend;
|
++strend;
|
||||||
*line = strend;
|
*line = strend;
|
||||||
return res;
|
return res;
|
||||||
@@ -1005,11 +1005,11 @@ API_EXPORT(int) ap_cfg_getline(char *buf, size_t bufsize, configfile_t *cfp)
|
|||||||
* Leading and trailing white space is eliminated completely
|
* Leading and trailing white space is eliminated completely
|
||||||
*/
|
*/
|
||||||
src = buf;
|
src = buf;
|
||||||
while (ap_isspace(*src))
|
while (apr_isspace(*src))
|
||||||
++src;
|
++src;
|
||||||
/* blast trailing whitespace */
|
/* blast trailing whitespace */
|
||||||
dst = &src[strlen(src)];
|
dst = &src[strlen(src)];
|
||||||
while (--dst >= src && ap_isspace(*dst))
|
while (--dst >= src && apr_isspace(*dst))
|
||||||
*dst = '\0';
|
*dst = '\0';
|
||||||
/* Zap leading whitespace by shifting */
|
/* Zap leading whitespace by shifting */
|
||||||
if (src != buf)
|
if (src != buf)
|
||||||
@@ -1070,7 +1070,7 @@ API_EXPORT(int) ap_cfg_getline(char *buf, size_t bufsize, configfile_t *cfp)
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
/* blast trailing whitespace */
|
/* blast trailing whitespace */
|
||||||
while (i > 0 && ap_isspace(buf[i - 1]))
|
while (i > 0 && apr_isspace(buf[i - 1]))
|
||||||
--i;
|
--i;
|
||||||
buf[i] = '\0';
|
buf[i] = '\0';
|
||||||
#ifdef DEBUG_CFG_LINES
|
#ifdef DEBUG_CFG_LINES
|
||||||
@@ -1099,7 +1099,7 @@ API_EXPORT(const char *) ap_size_list_item(const char **field, int *len)
|
|||||||
|
|
||||||
/* Find first non-comma, non-whitespace byte */
|
/* Find first non-comma, non-whitespace byte */
|
||||||
|
|
||||||
while (*ptr == ',' || ap_isspace(*ptr))
|
while (*ptr == ',' || apr_isspace(*ptr))
|
||||||
++ptr;
|
++ptr;
|
||||||
|
|
||||||
token = ptr;
|
token = ptr;
|
||||||
@@ -1138,7 +1138,7 @@ API_EXPORT(const char *) ap_size_list_item(const char **field, int *len)
|
|||||||
|
|
||||||
/* Advance field pointer to the next non-comma, non-white byte */
|
/* Advance field pointer to the next non-comma, non-white byte */
|
||||||
|
|
||||||
while (*ptr == ',' || ap_isspace(*ptr))
|
while (*ptr == ',' || apr_isspace(*ptr))
|
||||||
++ptr;
|
++ptr;
|
||||||
|
|
||||||
*field = (const char *)ptr;
|
*field = (const char *)ptr;
|
||||||
@@ -1224,7 +1224,7 @@ API_EXPORT(char *) ap_get_list_item(apr_pool_t *p, const char **field)
|
|||||||
default : if (addspace == 1)
|
default : if (addspace == 1)
|
||||||
*pos++ = ' ';
|
*pos++ = ' ';
|
||||||
*pos++ = (in_com || in_qstr) ? *ptr
|
*pos++ = (in_com || in_qstr) ? *ptr
|
||||||
: ap_tolower(*ptr);
|
: apr_tolower(*ptr);
|
||||||
addspace = 0;
|
addspace = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1253,7 +1253,7 @@ API_EXPORT(int) ap_find_list_item(apr_pool_t *p, const char *line, const char *t
|
|||||||
|
|
||||||
/* Find first non-comma, non-whitespace byte */
|
/* Find first non-comma, non-whitespace byte */
|
||||||
|
|
||||||
while (*ptr == ',' || ap_isspace(*ptr))
|
while (*ptr == ',' || apr_isspace(*ptr))
|
||||||
++ptr;
|
++ptr;
|
||||||
|
|
||||||
if (*ptr)
|
if (*ptr)
|
||||||
@@ -1322,7 +1322,7 @@ API_EXPORT(int) ap_find_list_item(apr_pool_t *p, const char *line, const char *t
|
|||||||
if (in_com || in_qstr)
|
if (in_com || in_qstr)
|
||||||
good = good && (*pos++ == *ptr);
|
good = good && (*pos++ == *ptr);
|
||||||
else
|
else
|
||||||
good = good && (*pos++ == ap_tolower(*ptr));
|
good = good && (*pos++ == apr_tolower(*ptr));
|
||||||
addspace = 0;
|
addspace = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1352,7 +1352,7 @@ API_EXPORT(char *) ap_get_token(apr_pool_t *p, const char **accept_line, int acc
|
|||||||
|
|
||||||
/* Find first non-white byte */
|
/* Find first non-white byte */
|
||||||
|
|
||||||
while (*ptr && ap_isspace(*ptr))
|
while (*ptr && apr_isspace(*ptr))
|
||||||
++ptr;
|
++ptr;
|
||||||
|
|
||||||
tok_start = ptr;
|
tok_start = ptr;
|
||||||
@@ -1361,7 +1361,7 @@ API_EXPORT(char *) ap_get_token(apr_pool_t *p, const char **accept_line, int acc
|
|||||||
* (comments are already gone).
|
* (comments are already gone).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
while (*ptr && (accept_white || !ap_isspace(*ptr))
|
while (*ptr && (accept_white || !apr_isspace(*ptr))
|
||||||
&& *ptr != ';' && *ptr != ',') {
|
&& *ptr != ';' && *ptr != ',') {
|
||||||
if (*ptr++ == '"')
|
if (*ptr++ == '"')
|
||||||
while (*ptr)
|
while (*ptr)
|
||||||
@@ -1374,7 +1374,7 @@ API_EXPORT(char *) ap_get_token(apr_pool_t *p, const char **accept_line, int acc
|
|||||||
|
|
||||||
/* Advance accept_line pointer to the next non-white byte */
|
/* Advance accept_line pointer to the next non-white byte */
|
||||||
|
|
||||||
while (*ptr && ap_isspace(*ptr))
|
while (*ptr && apr_isspace(*ptr))
|
||||||
++ptr;
|
++ptr;
|
||||||
|
|
||||||
*accept_line = ptr;
|
*accept_line = ptr;
|
||||||
@@ -1429,7 +1429,7 @@ API_EXPORT(int) ap_find_last_token(apr_pool_t *p, const char *line, const char *
|
|||||||
lidx = llen - tlen;
|
lidx = llen - tlen;
|
||||||
|
|
||||||
if ((lidx < 0) ||
|
if ((lidx < 0) ||
|
||||||
((lidx > 0) && !(ap_isspace(line[lidx - 1]) || line[lidx - 1] == ',')))
|
((lidx > 0) && !(apr_isspace(line[lidx - 1]) || line[lidx - 1] == ',')))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return (strncasecmp(&line[lidx], tok, tlen) == 0);
|
return (strncasecmp(&line[lidx], tok, tlen) == 0);
|
||||||
@@ -1512,7 +1512,7 @@ API_EXPORT(int) ap_unescape_url(char *url)
|
|||||||
if (*y != '%')
|
if (*y != '%')
|
||||||
*x = *y;
|
*x = *y;
|
||||||
else {
|
else {
|
||||||
if (!ap_isxdigit(*(y + 1)) || !ap_isxdigit(*(y + 2))) {
|
if (!apr_isxdigit(*(y + 1)) || !apr_isxdigit(*(y + 2))) {
|
||||||
badesc = 1;
|
badesc = 1;
|
||||||
*x = '%';
|
*x = '%';
|
||||||
}
|
}
|
||||||
@@ -1555,7 +1555,7 @@ API_EXPORT(char *) ap_construct_server(apr_pool_t *p, const char *hostname,
|
|||||||
*/
|
*/
|
||||||
static const char c2x_table[] = "0123456789abcdef";
|
static const char c2x_table[] = "0123456789abcdef";
|
||||||
|
|
||||||
static ap_inline unsigned char *c2x(unsigned what, unsigned char *where)
|
static apr_inline unsigned char *c2x(unsigned what, unsigned char *where)
|
||||||
{
|
{
|
||||||
#ifdef CHARSET_EBCDIC
|
#ifdef CHARSET_EBCDIC
|
||||||
what = ap_xlate_conv_byte(ap_hdrs_to_ascii, (unsigned char)what);
|
what = ap_xlate_conv_byte(ap_hdrs_to_ascii, (unsigned char)what);
|
||||||
@@ -1702,7 +1702,7 @@ API_EXPORT(int) ap_is_url(const char *u)
|
|||||||
|
|
||||||
for (x = 0; u[x] != ':'; x++) {
|
for (x = 0; u[x] != ':'; x++) {
|
||||||
if ((!u[x]) ||
|
if ((!u[x]) ||
|
||||||
((!ap_isalpha(u[x])) && (!ap_isdigit(u[x])) &&
|
((!apr_isalpha(u[x])) && (!apr_isdigit(u[x])) &&
|
||||||
(u[x] != '+') && (u[x] != '-') && (u[x] != '.'))) {
|
(u[x] != '+') && (u[x] != '-') && (u[x] != '.'))) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -1767,7 +1767,7 @@ API_EXPORT(int) ap_rind(const char *s, char c)
|
|||||||
API_EXPORT(void) ap_str_tolower(char *str)
|
API_EXPORT(void) ap_str_tolower(char *str)
|
||||||
{
|
{
|
||||||
while (*str) {
|
while (*str) {
|
||||||
*str = ap_tolower(*str);
|
*str = apr_tolower(*str);
|
||||||
++str;
|
++str;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1834,7 +1834,7 @@ unsigned long ap_get_virthost_addr(char *w, unsigned short *ports)
|
|||||||
return htonl(INADDR_ANY);
|
return htonl(INADDR_ANY);
|
||||||
}
|
}
|
||||||
|
|
||||||
my_addr = ap_inet_addr((char *)w);
|
my_addr = apr_inet_addr((char *)w);
|
||||||
if (my_addr != INADDR_NONE) {
|
if (my_addr != INADDR_NONE) {
|
||||||
if (p != NULL)
|
if (p != NULL)
|
||||||
*p = ':';
|
*p = ':';
|
||||||
@@ -1979,7 +1979,7 @@ API_EXPORT(void) ap_content_type_tolower(char *str)
|
|||||||
*semi = '\0';
|
*semi = '\0';
|
||||||
}
|
}
|
||||||
while (*str) {
|
while (*str) {
|
||||||
*str = ap_tolower(*str);
|
*str = apr_tolower(*str);
|
||||||
++str;
|
++str;
|
||||||
}
|
}
|
||||||
if (semi) {
|
if (semi) {
|
||||||
|
@@ -104,23 +104,23 @@ API_EXPORT(int) ap_checkmask(const char *data, const char *mask)
|
|||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
case '@':
|
case '@':
|
||||||
if (!ap_isupper(d))
|
if (!apr_isupper(d))
|
||||||
return 0;
|
return 0;
|
||||||
break;
|
break;
|
||||||
case '$':
|
case '$':
|
||||||
if (!ap_islower(d))
|
if (!apr_islower(d))
|
||||||
return 0;
|
return 0;
|
||||||
break;
|
break;
|
||||||
case '#':
|
case '#':
|
||||||
if (!ap_isdigit(d))
|
if (!apr_isdigit(d))
|
||||||
return 0;
|
return 0;
|
||||||
break;
|
break;
|
||||||
case '&':
|
case '&':
|
||||||
if (!ap_isxdigit(d))
|
if (!apr_isxdigit(d))
|
||||||
return 0;
|
return 0;
|
||||||
break;
|
break;
|
||||||
case '~':
|
case '~':
|
||||||
if ((d != ' ') && !ap_isdigit(d))
|
if ((d != ' ') && !apr_isdigit(d))
|
||||||
return 0;
|
return 0;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -182,7 +182,7 @@ API_EXPORT(int) ap_checkmask(const char *data, const char *mask)
|
|||||||
*/
|
*/
|
||||||
API_EXPORT(apr_time_t) ap_parseHTTPdate(const char *date)
|
API_EXPORT(apr_time_t) ap_parseHTTPdate(const char *date)
|
||||||
{
|
{
|
||||||
ap_exploded_time_t ds;
|
apr_exploded_time_t ds;
|
||||||
apr_time_t result;
|
apr_time_t result;
|
||||||
int mint, mon;
|
int mint, mon;
|
||||||
const char *monstr, *timstr;
|
const char *monstr, *timstr;
|
||||||
@@ -198,7 +198,7 @@ API_EXPORT(apr_time_t) ap_parseHTTPdate(const char *date)
|
|||||||
if (!date)
|
if (!date)
|
||||||
return BAD_DATE;
|
return BAD_DATE;
|
||||||
|
|
||||||
while (*date && ap_isspace(*date)) /* Find first non-whitespace char */
|
while (*date && apr_isspace(*date)) /* Find first non-whitespace char */
|
||||||
++date;
|
++date;
|
||||||
|
|
||||||
if (*date == '\0')
|
if (*date == '\0')
|
||||||
|
@@ -95,7 +95,7 @@
|
|||||||
API_EXPORT(char *) ap_md5_binary(apr_pool_t *p, const unsigned char *buf, int length)
|
API_EXPORT(char *) ap_md5_binary(apr_pool_t *p, const unsigned char *buf, int length)
|
||||||
{
|
{
|
||||||
const char *hex = "0123456789abcdef";
|
const char *hex = "0123456789abcdef";
|
||||||
ap_md5_ctx_t my_md5;
|
apr_md5_ctx_t my_md5;
|
||||||
unsigned char hash[MD5_DIGESTSIZE];
|
unsigned char hash[MD5_DIGESTSIZE];
|
||||||
char *r, result[33];
|
char *r, result[33];
|
||||||
int i;
|
int i;
|
||||||
@@ -170,7 +170,7 @@ API_EXPORT(char *) ap_md5(apr_pool_t *p, const unsigned char *string)
|
|||||||
static char basis_64[] =
|
static char basis_64[] =
|
||||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||||
|
|
||||||
API_EXPORT(char *) ap_md5contextTo64(apr_pool_t *a, ap_md5_ctx_t *context)
|
API_EXPORT(char *) ap_md5contextTo64(apr_pool_t *a, apr_md5_ctx_t *context)
|
||||||
{
|
{
|
||||||
unsigned char digest[18];
|
unsigned char digest[18];
|
||||||
char *encodedDigest;
|
char *encodedDigest;
|
||||||
@@ -200,7 +200,7 @@ API_EXPORT(char *) ap_md5contextTo64(apr_pool_t *a, ap_md5_ctx_t *context)
|
|||||||
API_EXPORT(char *) ap_md5digest(apr_pool_t *p, apr_file_t *infile,
|
API_EXPORT(char *) ap_md5digest(apr_pool_t *p, apr_file_t *infile,
|
||||||
apr_xlate_t *xlate)
|
apr_xlate_t *xlate)
|
||||||
{
|
{
|
||||||
ap_md5_ctx_t context;
|
apr_md5_ctx_t context;
|
||||||
unsigned char buf[1000];
|
unsigned char buf[1000];
|
||||||
long length = 0;
|
long length = 0;
|
||||||
int nbytes;
|
int nbytes;
|
||||||
@@ -223,7 +223,7 @@ API_EXPORT(char *) ap_md5digest(apr_pool_t *p, apr_file_t *infile,
|
|||||||
|
|
||||||
API_EXPORT(char *) ap_md5digest(apr_pool_t *p, apr_file_t *infile)
|
API_EXPORT(char *) ap_md5digest(apr_pool_t *p, apr_file_t *infile)
|
||||||
{
|
{
|
||||||
ap_md5_ctx_t context;
|
apr_md5_ctx_t context;
|
||||||
unsigned char buf[1000];
|
unsigned char buf[1000];
|
||||||
long length = 0;
|
long length = 0;
|
||||||
apr_ssize_t nbytes;
|
apr_ssize_t nbytes;
|
||||||
|
@@ -103,11 +103,11 @@ static char *http2env(apr_pool_t *a, char *w)
|
|||||||
char *cp = res;
|
char *cp = res;
|
||||||
|
|
||||||
while (*++cp) {
|
while (*++cp) {
|
||||||
if (!ap_isalnum(*cp) && *cp != '_') {
|
if (!apr_isalnum(*cp) && *cp != '_') {
|
||||||
*cp = '_';
|
*cp = '_';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
*cp = ap_toupper(*cp);
|
*cp = apr_toupper(*cp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,7 +116,7 @@ static char *http2env(apr_pool_t *a, char *w)
|
|||||||
|
|
||||||
API_EXPORT(char **) ap_create_environment(apr_pool_t *p, apr_table_t *t)
|
API_EXPORT(char **) ap_create_environment(apr_pool_t *p, apr_table_t *t)
|
||||||
{
|
{
|
||||||
apr_array_header_t *env_arr = ap_table_elts(t);
|
apr_array_header_t *env_arr = apr_table_elts(t);
|
||||||
apr_table_entry_t *elts = (apr_table_entry_t *) env_arr->elts;
|
apr_table_entry_t *elts = (apr_table_entry_t *) env_arr->elts;
|
||||||
char **env = (char **) apr_palloc(p, (env_arr->nelts + 2) * sizeof(char *));
|
char **env = (char **) apr_palloc(p, (env_arr->nelts + 2) * sizeof(char *));
|
||||||
int i, j;
|
int i, j;
|
||||||
@@ -136,11 +136,11 @@ API_EXPORT(char **) ap_create_environment(apr_pool_t *p, apr_table_t *t)
|
|||||||
}
|
}
|
||||||
env[j] = apr_pstrcat(p, elts[i].key, "=", elts[i].val, NULL);
|
env[j] = apr_pstrcat(p, elts[i].key, "=", elts[i].val, NULL);
|
||||||
whack = env[j];
|
whack = env[j];
|
||||||
if (ap_isdigit(*whack)) {
|
if (apr_isdigit(*whack)) {
|
||||||
*whack++ = '_';
|
*whack++ = '_';
|
||||||
}
|
}
|
||||||
while (*whack != '=') {
|
while (*whack != '=') {
|
||||||
if (!ap_isalnum(*whack) && *whack != '_') {
|
if (!apr_isalnum(*whack) && *whack != '_') {
|
||||||
*whack = '_';
|
*whack = '_';
|
||||||
}
|
}
|
||||||
++whack;
|
++whack;
|
||||||
@@ -163,7 +163,7 @@ API_EXPORT(void) ap_add_common_vars(request_rec *r)
|
|||||||
char *env_temp;
|
char *env_temp;
|
||||||
#endif
|
#endif
|
||||||
const char *host;
|
const char *host;
|
||||||
apr_array_header_t *hdrs_arr = ap_table_elts(r->headers_in);
|
apr_array_header_t *hdrs_arr = apr_table_elts(r->headers_in);
|
||||||
apr_table_entry_t *hdrs = (apr_table_entry_t *) hdrs_arr->elts;
|
apr_table_entry_t *hdrs = (apr_table_entry_t *) hdrs_arr->elts;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -281,7 +281,7 @@ API_EXPORT(void) ap_add_common_vars(request_rec *r)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
apr_overlap_tables(r->subprocess_env, e, AP_OVERLAP_TABLES_SET);
|
apr_overlap_tables(r->subprocess_env, e, APR_OVERLAP_TABLES_SET);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This "cute" little function comes about because the path info on
|
/* This "cute" little function comes about because the path info on
|
||||||
@@ -319,15 +319,15 @@ static char *original_uri(request_rec *r)
|
|||||||
|
|
||||||
first = r->the_request; /* use the request-line */
|
first = r->the_request; /* use the request-line */
|
||||||
|
|
||||||
while (*first && !ap_isspace(*first)) {
|
while (*first && !apr_isspace(*first)) {
|
||||||
++first; /* skip over the method */
|
++first; /* skip over the method */
|
||||||
}
|
}
|
||||||
while (ap_isspace(*first)) {
|
while (apr_isspace(*first)) {
|
||||||
++first; /* and the space(s) */
|
++first; /* and the space(s) */
|
||||||
}
|
}
|
||||||
|
|
||||||
last = first;
|
last = first;
|
||||||
while (*last && !ap_isspace(*last)) {
|
while (*last && !apr_isspace(*last)) {
|
||||||
++last; /* end at next whitespace */
|
++last; /* end at next whitespace */
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -474,8 +474,8 @@ API_EXPORT(int) ap_scan_script_header_err_core(request_rec *r, char *buffer,
|
|||||||
cond_status = ap_meets_conditions(r);
|
cond_status = ap_meets_conditions(r);
|
||||||
}
|
}
|
||||||
apr_overlap_tables(r->err_headers_out, merge,
|
apr_overlap_tables(r->err_headers_out, merge,
|
||||||
AP_OVERLAP_TABLES_MERGE);
|
APR_OVERLAP_TABLES_MERGE);
|
||||||
if (!ap_is_empty_table(cookie_table)) {
|
if (!apr_is_empty_table(cookie_table)) {
|
||||||
/* the cookies have already been copied to the cookie_table */
|
/* the cookies have already been copied to the cookie_table */
|
||||||
apr_table_unset(r->err_headers_out, "Set-Cookie");
|
apr_table_unset(r->err_headers_out, "Set-Cookie");
|
||||||
r->err_headers_out = apr_overlay_tables(r->pool,
|
r->err_headers_out = apr_overlay_tables(r->pool,
|
||||||
@@ -532,7 +532,7 @@ API_EXPORT(int) ap_scan_script_header_err_core(request_rec *r, char *buffer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
*l++ = '\0';
|
*l++ = '\0';
|
||||||
while (*l && ap_isspace(*l)) {
|
while (*l && apr_isspace(*l)) {
|
||||||
++l;
|
++l;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -542,7 +542,7 @@ API_EXPORT(int) ap_scan_script_header_err_core(request_rec *r, char *buffer,
|
|||||||
/* Nuke trailing whitespace */
|
/* Nuke trailing whitespace */
|
||||||
|
|
||||||
char *endp = l + strlen(l) - 1;
|
char *endp = l + strlen(l) - 1;
|
||||||
while (endp > l && ap_isspace(*endp)) {
|
while (endp > l && apr_isspace(*endp)) {
|
||||||
*endp-- = '\0';
|
*endp-- = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -221,7 +221,7 @@ static const char *get_addresses(apr_pool_t *p, const char *w_,
|
|||||||
my_addr = DEFAULT_VHOST_ADDR;
|
my_addr = DEFAULT_VHOST_ADDR;
|
||||||
is_an_ip_addr = 1;
|
is_an_ip_addr = 1;
|
||||||
}
|
}
|
||||||
else if ((my_addr = ap_inet_addr(w)) != INADDR_NONE) {
|
else if ((my_addr = apr_inet_addr(w)) != INADDR_NONE) {
|
||||||
is_an_ip_addr = 1;
|
is_an_ip_addr = 1;
|
||||||
}
|
}
|
||||||
if (is_an_ip_addr) {
|
if (is_an_ip_addr) {
|
||||||
@@ -354,7 +354,7 @@ static void dump_iphash_statistics(server_rec *main_s)
|
|||||||
*
|
*
|
||||||
* Hash function provided by David Hankins.
|
* Hash function provided by David Hankins.
|
||||||
*/
|
*/
|
||||||
static ap_inline unsigned hash_inaddr(unsigned key)
|
static apr_inline unsigned hash_inaddr(unsigned key)
|
||||||
{
|
{
|
||||||
key ^= (key >> 16);
|
key ^= (key >> 16);
|
||||||
return ((key >> 8) ^ key) % IPHASH_TABLE_SIZE;
|
return ((key >> 8) ^ key) % IPHASH_TABLE_SIZE;
|
||||||
@@ -388,7 +388,7 @@ static name_chain *new_name_chain(apr_pool_t *p, server_rec *s, server_addr_rec
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static ap_inline ipaddr_chain *find_ipaddr(struct in_addr *server_ip,
|
static apr_inline ipaddr_chain *find_ipaddr(struct in_addr *server_ip,
|
||||||
unsigned port)
|
unsigned port)
|
||||||
{
|
{
|
||||||
unsigned bucket;
|
unsigned bucket;
|
||||||
@@ -687,7 +687,7 @@ static void fix_hostname(request_rec *r)
|
|||||||
src = r->hostname;
|
src = r->hostname;
|
||||||
dst = host;
|
dst = host;
|
||||||
while (*src) {
|
while (*src) {
|
||||||
if (!ap_isalnum(*src) && *src != '.' && *src != '-') {
|
if (!apr_isalnum(*src) && *src != '.' && *src != '-') {
|
||||||
if (*src == ':')
|
if (*src == ':')
|
||||||
break;
|
break;
|
||||||
else
|
else
|
||||||
@@ -699,7 +699,7 @@ static void fix_hostname(request_rec *r)
|
|||||||
/* check the port part */
|
/* check the port part */
|
||||||
if (*src++ == ':') {
|
if (*src++ == ':') {
|
||||||
while (*src) {
|
while (*src) {
|
||||||
if (!ap_isdigit(*src++)) {
|
if (!apr_isdigit(*src++)) {
|
||||||
goto bad;
|
goto bad;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -67,7 +67,7 @@ RSC=rc.exe
|
|||||||
# ADD BASE RSC /l 0x409
|
# ADD BASE RSC /l 0x409
|
||||||
# ADD RSC /l 0x409
|
# ADD RSC /l 0x409
|
||||||
# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c
|
# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c
|
||||||
# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /D "_WIN32" /D "_DEBUG" /D "_WINDOWS" /D "STATIC" /FD /c
|
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /D "_WIN32" /D "_DEBUG" /D "_WINDOWS" /D "STATIC" /FD /c
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
# ADD BASE BSC32 /nologo
|
# ADD BASE BSC32 /nologo
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
|
@@ -67,7 +67,7 @@ RSC=rc.exe
|
|||||||
# ADD BASE RSC /l 0x409
|
# ADD BASE RSC /l 0x409
|
||||||
# ADD RSC /l 0x409
|
# ADD RSC /l 0x409
|
||||||
# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c
|
# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c
|
||||||
# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /D "_WIN32" /D "_DEBUG" /D "_WINDOWS" /D "STATIC" /FD /c
|
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /D "_WIN32" /D "_DEBUG" /D "_WINDOWS" /D "STATIC" /FD /c
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
# ADD BASE BSC32 /nologo
|
# ADD BASE BSC32 /nologo
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
|
52
support/ab.c
52
support/ab.c
@@ -190,7 +190,7 @@ char cookie[1024], /* optional cookie line */
|
|||||||
* authentification */
|
* authentification */
|
||||||
hdrs[4096]; /* optional arbitrary headers */
|
hdrs[4096]; /* optional arbitrary headers */
|
||||||
int port = 80; /* port number */
|
int port = 80; /* port number */
|
||||||
time_t aprtimeout = 30 * AP_USEC_PER_SEC; /* timeout value */
|
time_t aprtimeout = 30 * APR_USEC_PER_SEC; /* timeout value */
|
||||||
|
|
||||||
int use_html = 0; /* use html in the report */
|
int use_html = 0; /* use html in the report */
|
||||||
char *tablestring;
|
char *tablestring;
|
||||||
@@ -259,7 +259,7 @@ static void write_request(struct connection *c)
|
|||||||
{
|
{
|
||||||
apr_ssize_t len = reqlen;
|
apr_ssize_t len = reqlen;
|
||||||
c->connect = apr_now();
|
c->connect = apr_now();
|
||||||
apr_setsocketopt(c->aprsock, APR_SO_TIMEOUT, 30 * AP_USEC_PER_SEC);
|
apr_setsocketopt(c->aprsock, APR_SO_TIMEOUT, 30 * APR_USEC_PER_SEC);
|
||||||
if (apr_send(c->aprsock, request, &reqlen) != APR_SUCCESS ||
|
if (apr_send(c->aprsock, request, &reqlen) != APR_SUCCESS ||
|
||||||
reqlen != len) {
|
reqlen != len) {
|
||||||
printf("Send request failed!\n");
|
printf("Send request failed!\n");
|
||||||
@@ -815,12 +815,12 @@ static void test(void)
|
|||||||
|
|
||||||
/* check for time limit expiry */
|
/* check for time limit expiry */
|
||||||
now = apr_now();
|
now = apr_now();
|
||||||
timed = (now - start) / AP_USEC_PER_SEC;
|
timed = (now - start) / APR_USEC_PER_SEC;
|
||||||
if (tlimit && timed > (tlimit * 1000)) {
|
if (tlimit && timed > (tlimit * 1000)) {
|
||||||
requests = done; /* so stats are correct */
|
requests = done; /* so stats are correct */
|
||||||
}
|
}
|
||||||
/* Timeout of 30 seconds. */
|
/* Timeout of 30 seconds. */
|
||||||
timeout = 30 * AP_USEC_PER_SEC;
|
timeout = 30 * APR_USEC_PER_SEC;
|
||||||
|
|
||||||
n = concurrency;
|
n = concurrency;
|
||||||
status = apr_poll(readbits, &n, timeout);
|
status = apr_poll(readbits, &n, timeout);
|
||||||
@@ -862,14 +862,14 @@ static void test(void)
|
|||||||
static void copyright(void)
|
static void copyright(void)
|
||||||
{
|
{
|
||||||
if (!use_html) {
|
if (!use_html) {
|
||||||
printf("This is ApacheBench, Version %s\n", AB_VERSION " <$Revision: 1.21 $> apache-2.0");
|
printf("This is ApacheBench, Version %s\n", AB_VERSION " <$Revision: 1.22 $> apache-2.0");
|
||||||
printf("Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n");
|
printf("Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n");
|
||||||
printf("Copyright (c) 1998-2000 The Apache Software Foundation, http://www.apache.org/\n");
|
printf("Copyright (c) 1998-2000 The Apache Software Foundation, http://www.apache.org/\n");
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
printf("<p>\n");
|
printf("<p>\n");
|
||||||
printf(" This is ApacheBench, Version %s <i><%s></i> apache-2.0<br>\n", AB_VERSION, "$Revision: 1.21 $");
|
printf(" This is ApacheBench, Version %s <i><%s></i> apache-2.0<br>\n", AB_VERSION, "$Revision: 1.22 $");
|
||||||
printf(" Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/<br>\n");
|
printf(" Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/<br>\n");
|
||||||
printf(" Copyright (c) 1998-2000 The Apache Software Foundation, http://www.apache.org/<br>\n");
|
printf(" Copyright (c) 1998-2000 The Apache Software Foundation, http://www.apache.org/<br>\n");
|
||||||
printf("</p>\n<p>\n");
|
printf("</p>\n<p>\n");
|
||||||
@@ -1006,11 +1006,11 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ap_optind = 1;
|
apr_optind = 1;
|
||||||
while (apr_getopt(argc, argv, "n:c:t:T:p:v:kVhwix:y:z:C:H:P:A:", &c, cntxt) == APR_SUCCESS) {
|
while (apr_getopt(argc, argv, "n:c:t:T:p:v:kVhwix:y:z:C:H:P:A:", &c, cntxt) == APR_SUCCESS) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'n':
|
case 'n':
|
||||||
requests = atoi(ap_optarg);
|
requests = atoi(apr_optarg);
|
||||||
if (!requests) {
|
if (!requests) {
|
||||||
err("Invalid number of requests\n");
|
err("Invalid number of requests\n");
|
||||||
}
|
}
|
||||||
@@ -1019,7 +1019,7 @@ int main(int argc, char **argv)
|
|||||||
keepalive = 1;
|
keepalive = 1;
|
||||||
break;
|
break;
|
||||||
case 'c':
|
case 'c':
|
||||||
concurrency = atoi(ap_optarg);
|
concurrency = atoi(apr_optarg);
|
||||||
break;
|
break;
|
||||||
case 'i':
|
case 'i':
|
||||||
if (posting == 1)
|
if (posting == 1)
|
||||||
@@ -1030,7 +1030,7 @@ int main(int argc, char **argv)
|
|||||||
if (posting != 0)
|
if (posting != 0)
|
||||||
err("Cannot mix POST and HEAD\n");
|
err("Cannot mix POST and HEAD\n");
|
||||||
|
|
||||||
if (0 == (r = open_postfile(ap_optarg))) {
|
if (0 == (r = open_postfile(apr_optarg))) {
|
||||||
posting = 1;
|
posting = 1;
|
||||||
}
|
}
|
||||||
else if (postdata) {
|
else if (postdata) {
|
||||||
@@ -1038,27 +1038,27 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'v':
|
case 'v':
|
||||||
verbosity = atoi(ap_optarg);
|
verbosity = atoi(apr_optarg);
|
||||||
break;
|
break;
|
||||||
case 't':
|
case 't':
|
||||||
tlimit = atoi(ap_optarg);
|
tlimit = atoi(apr_optarg);
|
||||||
requests = MAX_REQUESTS; /* need to size data array on something */
|
requests = MAX_REQUESTS; /* need to size data array on something */
|
||||||
break;
|
break;
|
||||||
case 'T':
|
case 'T':
|
||||||
strcpy(content_type, ap_optarg);
|
strcpy(content_type, apr_optarg);
|
||||||
break;
|
break;
|
||||||
case 'C':
|
case 'C':
|
||||||
strncat(cookie, "Cookie: ", sizeof(cookie));
|
strncat(cookie, "Cookie: ", sizeof(cookie));
|
||||||
strncat(cookie, ap_optarg, sizeof(cookie));
|
strncat(cookie, apr_optarg, sizeof(cookie));
|
||||||
strncat(cookie, "\r\n", sizeof(cookie));
|
strncat(cookie, "\r\n", sizeof(cookie));
|
||||||
break;
|
break;
|
||||||
case 'A':
|
case 'A':
|
||||||
/* assume username passwd already to be in colon separated form.
|
/* assume username passwd already to be in colon separated form.
|
||||||
* Ready to be uu-encoded.
|
* Ready to be uu-encoded.
|
||||||
*/
|
*/
|
||||||
while(isspace(*ap_optarg))
|
while(isspace(*apr_optarg))
|
||||||
ap_optarg++;
|
apr_optarg++;
|
||||||
l=ap_base64encode(tmp, ap_optarg, strlen(ap_optarg));
|
l=ap_base64encode(tmp, apr_optarg, strlen(apr_optarg));
|
||||||
tmp[l]='\0';
|
tmp[l]='\0';
|
||||||
|
|
||||||
strncat(auth, "Authorization: basic ", sizeof(auth));
|
strncat(auth, "Authorization: basic ", sizeof(auth));
|
||||||
@@ -1069,9 +1069,9 @@ int main(int argc, char **argv)
|
|||||||
/*
|
/*
|
||||||
* assume username passwd already to be in colon separated form.
|
* assume username passwd already to be in colon separated form.
|
||||||
*/
|
*/
|
||||||
while(isspace(*ap_optarg))
|
while(isspace(*apr_optarg))
|
||||||
ap_optarg++;
|
apr_optarg++;
|
||||||
l=ap_base64encode(tmp, ap_optarg, strlen(ap_optarg));
|
l=ap_base64encode(tmp, apr_optarg, strlen(apr_optarg));
|
||||||
tmp[l]='\0';
|
tmp[l]='\0';
|
||||||
|
|
||||||
strncat(auth, "Proxy-Authorization: basic ", sizeof(auth));
|
strncat(auth, "Proxy-Authorization: basic ", sizeof(auth));
|
||||||
@@ -1079,7 +1079,7 @@ int main(int argc, char **argv)
|
|||||||
strncat(auth, "\r\n", sizeof(auth));
|
strncat(auth, "\r\n", sizeof(auth));
|
||||||
break;
|
break;
|
||||||
case 'H':
|
case 'H':
|
||||||
strncat(hdrs, ap_optarg, sizeof(hdrs));
|
strncat(hdrs, apr_optarg, sizeof(hdrs));
|
||||||
strncat(hdrs, "\r\n", sizeof(hdrs));
|
strncat(hdrs, "\r\n", sizeof(hdrs));
|
||||||
break;
|
break;
|
||||||
case 'w':
|
case 'w':
|
||||||
@@ -1091,15 +1091,15 @@ int main(int argc, char **argv)
|
|||||||
*/
|
*/
|
||||||
case 'x':
|
case 'x':
|
||||||
use_html = 1;
|
use_html = 1;
|
||||||
tablestring = ap_optarg;
|
tablestring = apr_optarg;
|
||||||
break;
|
break;
|
||||||
case 'y':
|
case 'y':
|
||||||
use_html = 1;
|
use_html = 1;
|
||||||
trstring = ap_optarg;
|
trstring = apr_optarg;
|
||||||
break;
|
break;
|
||||||
case 'z':
|
case 'z':
|
||||||
use_html = 1;
|
use_html = 1;
|
||||||
tdstring = ap_optarg;
|
tdstring = apr_optarg;
|
||||||
break;
|
break;
|
||||||
case 'h':
|
case 'h':
|
||||||
usage(argv[0]);
|
usage(argv[0]);
|
||||||
@@ -1110,12 +1110,12 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ap_optind != argc - 1) {
|
if (apr_optind != argc - 1) {
|
||||||
fprintf(stderr, "%s: wrong number of arguments\n", argv[0]);
|
fprintf(stderr, "%s: wrong number of arguments\n", argv[0]);
|
||||||
usage(argv[0]);
|
usage(argv[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parse_url(argv[ap_optind++])) {
|
if (parse_url(argv[apr_optind++])) {
|
||||||
fprintf(stderr, "%s: invalid URL\n", argv[0]);
|
fprintf(stderr, "%s: invalid URL\n", argv[0]);
|
||||||
usage(argv[0]);
|
usage(argv[0]);
|
||||||
}
|
}
|
||||||
|
@@ -157,7 +157,7 @@ static void putline(apr_file_t *f, char *l)
|
|||||||
static void add_password(char *user, char *realm, apr_file_t *f)
|
static void add_password(char *user, char *realm, apr_file_t *f)
|
||||||
{
|
{
|
||||||
char *pw;
|
char *pw;
|
||||||
ap_md5_ctx_t context;
|
apr_md5_ctx_t context;
|
||||||
unsigned char digest[16];
|
unsigned char digest[16];
|
||||||
char string[MAX_STRING_LEN];
|
char string[MAX_STRING_LEN];
|
||||||
char pwin[MAX_STRING_LEN];
|
char pwin[MAX_STRING_LEN];
|
||||||
|
Reference in New Issue
Block a user